re you would need to log in after
having made that change in order for bash to read the file and the
effect to be seen. Did you log in after having made that change? Was
bash invoked as an interactive login shell so that it would read that
file?
echo $0
echo $-
Bob
Carl Wenrich wrote:
> Bob Proulx wrote:
> > Did you log in after having made that change? Was bash invoked as
> > an interactive login shell so that it would read that file?
> >
> > echo $0
> > echo $-
>
> Yes. I (1) made the change to .bash_profile, th
rrors to /dev/null effectively ignoring
them. Other systems will be similarly different.
In any case I believe you have an answer to your question about why
your ~/.bash_profile wasn't being sourced. It wasn't being sourced
because your shell isn't invoked as a login shell and therefore
shouldn't source it.
Good luck!
Bob
s is off topic for the bash list. If you have further problems the
Ubuntu user mailing list would probably be your best place for more
help about how to configure your Ubuntu system. If you contact me
offlist I would continue to help you if you have problems with setting
up an ~/.xsession file.
Bob
; echo $CASEMATCH two
> ;;
> esac
Perhaps matching again?
foo="lawlesspoets"
case $foo in
*poets)
echo ${foo/*poets/one}
echo ${foo%poets} one
;;
lawless*)
echo ${foo/lawless*/two}
echo ${foo#lawless} two
;;
esac
Bob
Peter Volkov wrote:
> Bob Proulx пишет:
> > The $0 is the name used to invoke the shell. If it starts with a '-'
> > then this is used to instruct the shell that it is a login shell. The
> > second variable $- is the flags set to the shell. The 'i
n that would be a bug. It would then need to be
stated in a way that others may reproduce the bug in order to fix it.
Bob
desire. But in order to
get help from other people you would need to motivate them as to why
you are one of the 0.01% of the people who would need to do this.
What are you trying to do that causes you to want to create new built
in commands?
Bob
(C-o)
Accept the current line for execution and fetch the next
line relative to the current line from the history for
editing.
Bob
output
That will use ssh without reading stdin to the remote host machine and
on the remote host will execute tail of the there file and the stdout
will be appended to output on the local filesystem.
Note that the appending of the output seems suspicious to me. This
will duplicate the lines if the command is run multiple times.
Bob
read.gmane.org/gmane.comp.shells.bash.bugs/11566
Gmane seems to be one of the better web based mailing list and
newgroup readers out there.
Bob
[1] For example Nabble apparently allows senders to edit their draft
and send a message multiple times with the same message-id! So we get
several m
hat there is another one that
you are not expecting that is running.
Bob
s
> quoted appropriately.
Of course that makes sense for the "==" and "!=" cases. But is that
true even for the "=" case? For the "=" case I thought it was
"STRING1 = STRING2" and not "STRING = PATTERN".
Could you clarify the rules and educate us?
Thanks
Bob
Chet Ramey wrote:
> Bob Proulx wrote:
> >Of course that makes sense for the "==" and "!=" cases. But is that
> >true even for the "=" case? For the "=" case I thought it was
> >"STRING1 = STRING2" and not "STRING
Again the key part of the manual says:
If no names are supplied, the line read is assigned to the variable REPLY.
Bob
is the resultant list. If parameter is
an array variable subscripted with @ or *, the pattern removal
operation is applied to each member of the array in turn, and
the expansion is the resultant list.
Bob
= line is incorrect syntax. See the bash manual section on
command substitution.
> I get:
> bash: 001: command not found
Because in your version the variable chg is set to "echo" as an
environment variable for the $f command and $f is 001, 002, etc.
Try this:
for f in *; do
chg=$(echo "$f" |sed 's: *(www.somewhere.net)::')
mv "$f" "$chg"
done
Bob
just a comment section this doesn't seem to be a compelling need.
For that you would need to show how writing state-machines or
something is so much easier or some such...
Since there are other possibilities I would vote to maintain the
status quo.
Bob
Richard Neill wrote:
> Bob Proulx wrote:
> >In the future please start a new message for a new thread of
> >discussion. When you reply to old messages from three months ago
> >those of us who actually keep months worth of email see the message
> >threaded with th
ect its exit status.
> This is how all builtins that affect variable attributes (declare/typeset,
> export, readonly) should behave.
Note that this is also the way "export" works too.
Bob
isn't ok
> for this application.
Sorry but the description is too vague. Can you reduce this to a
simple few lines and show it to us?
Bob
o "$x" | sed 's/.*_b\([0-9][0-9]*[.][0-9][0-9]*\).*/\1/')
echo "$b"
3.45
But it certainly seems reasonable to use the bash parameter expansion
methods to do something similar.
$ echo ${x%%ms*}
mq001234
But my brain doesn't think that way and so I didn't work up a full
procedure.
Bob
27;t see it. I guess it could
> poll the current children with ps, but that seems kind of ugly.
I have written such a thing in Perl and am aware of the issues. I am
sure something like it could be useful to many people in bash too if
you decided to write it and contribute it.
Bob
confident this guess is very likely.
I much prefer it when people's superstitions are restricted to
avoiding walking under ladders or wearing a certain same pair of socks
on game days. Those things don't adversely affect the code they leave
behind. :-)
> (I also plan to corner him on the exact circumstances of this bug, but
> wanted to explore this avenue in parallel.)
Good luck!
Bob
r las listas de paquetes o el archivo de
> estado.'
Since you are using Ubuntu then the Ubuntu users mailing lists would
be a better source of information.
http://www.ubuntu.com/support/communitysupport
http://www.ubuntu.com/support/community/mailinglists
Bob
link to
`/usr/local/sys' then:
$ cd /usr/sys; echo $PWD
/usr/sys
$ cd ..; pwd
/usr
If `set -P' is on, then:
$ cd /usr/sys; echo $PWD
/usr/local/sys
$ cd ..; pwd
/usr/local
Try setting either 'set -o physical' or equivalently 'set -P' in your
$HOME/.bashrc file and you will always follow the physical path.
Hope this helps,
Bob
am
EOF
Use "EOF" instead if you want $variables to be expanded locally in the
script but then you need to be aware of the local expansion and quote
any that you don't want expanded.
Also, using full paths is frowned upon.
Bob
> I've tracked it down.
> mingetty exec's /bin/login, which calls pam stuff, which in turn uses
> libdbus. And that is the culprit:
>
> ./dbus/dbus-sysdeps-unix.c-_dbus_disable_sigpipe (void)
> ./dbus/dbus-sysdeps-unix.c-{
> ./dbus/dbus-sysdeps-unix.c: signal (SIGPIPE, SIG_IGN);
> ./dbus/dbus-sysdeps-unix.c-}
Bob
Paul Jarc wrote:
> Bob Proulx wrote:
> > Also, using full paths is frowned upon.
>
> You mean invoking /directory/some-command directly instead of
> PATH=$PATH:/directory
> some-command
> ?
Yes. That is what I am saying.
> It depends on the situation.
I can'
ns and other shells didn't used to report the error
this way and would often confuse people. Therefore if this is the
problem ("if" because I could guess completely wrong here) then I
think it indicates that you are using an older version of bash.
Bob
programfile' to the debug testing
route in the future then to catch that case.
Glad to hear you solved your problem.
Bob
ting the colon (':') results in a
test only for a parameter that is unset.
Then searches on ":" would also find that descriptive text too.
Bob
executed:
if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
but the value of the PATH variable is not used to search for the file
name.
Bob
eneville_ wrote:
> Bob Proulx wrote:
> > Look at the documentation for BASH_ENV in the bash manual.
>
> Thanks. But this isn't having the effect that I wished for.
>
> What I'm hoping to achieve is to have bash run something like a wrapper
> around each
confused with the original behavior.
Let me add my voice to the request to name it something different to
avoid the confusion. That would leave the door open in the future for
a true emacs compatible dabbrev-expand implementation when operating
in emacs mode.
Thanks
Bob
& $field3 = 45 ]]; then field4=$(($field4 - 5)); fi
echo $field1 $field2 $field3 $field4
done
There are endless variations but this matched your description fairly
closely.
Bob
garp28 wrote:
> ssh -T ${SRI} < su - simrun -c "/tmp/stop_sri.sh"
> EOF
>
> I would like to redirect the output of the stop_sri.sh into a local log.
> How can I do that?
Use '>' to redirect the outout. For example:
ssh -T ${SRI} >stop_sri.log <
is to add an eval.
$ eval echo hello $x
And similarly for your case:
eval ${commands[ran]} &
This will process redirections, expand variables, then run the eval
which will do it all again and on the second pass handle the newly
appearing redirections that results from the previous variable
expansion.
Bob
#Opening-the-software-toolbox
The above is also in the coreutils info documentation.
info coreutils 'Toolbox Introduction'
Bob
P.S. The best place for GNU coreutils specific discussions is on the
bug-coreutils mailing list.
have the same effect.
> > I actually had some useful code including parameter expansions
> > going on in my PROMPT_COMMAND.
So the fact that it is mostly a noop accomplishes the effect Ian was
needing in order to produce a small bug case. Perhaps he could have
used $(:) instead to make it more obvious? (shrug)
Bob
hell
holds the file descriptors in program variables. These variables are
assigned in the order seen on the command line from left to right.
The following pseudo code isn't from the actual shell code but perhaps
thinking of it this way will help model it for you.
">FILE 2>&1" # Redirects both stdout and stderr to FILE.
1>FILE # fd[1] = open_for_reading(FILE)
2>&1# fd[2] = fd[1]
"2>&1 >FILE" # Redirects stderr. Redirects stdout to file.
2>&1# fd[2] = fd[1]
1>FILE # fd[1] = open_for_reading(FILE)
In the second case it should now be apparent that the stderr isn't
associated with FILE because of the ordering.
Bob
PATH=$HOME/bin:$PATH
SHELL=$HOME/bin/bash
exec $SHELL
Remember that exec overlays the current process replacing it with the
new process. Nothing in the same file after the exec will be run. It
exits the current file at that point.
Bob
e bashdb.el file and read it. There should be comments at the
top that inform how to use it.
Bob
ficient then you would need to write it out
in long form.
SHELL="/first/path/to/check/for/bash-3.2.48/bin/bash"
if [ -x "$SHELL" ]; then
exec "$SHELL"
else
SHELL="/some/other/path/to/bash-3.2.48/bin/bash"
if [ -x "$SHELL" ]; then
exec "$SHELL"
fi
fi
echo "Unable to exec my custom shell."
Bob
devoted to shell programming.
Bob
f mail going through lists.gnu.org but
since I am one of the mailing list moderators I am biased. :-)
This beat out this next posting 15m19s later which went through
without delay at 21 Mar 2009 13:38:08 -0600 because it was a known
address.
Bob
came on the scene with defined behavior. So you are
doing well to have used printf in your solution.
Bob
is not under the control of traceroute (and certainly has
nothing to do with bash) and is totally under the control of the
networking provided either by your ISP or by network providers
contracted by your ISP.
If you have questions concerning your network routing then you need to
talk with your ISP.
Bob
one on the remote
machine and it would operate in a standard environment. But you
didn't give an example of what you were wanting so I can't guess if
you were trying to set PATH or desiring an alias or function to exist
or what. So I realize that this answer will be unsatisfying in that
regard.
Hope this helps,
Bob
lists.gnu.org
munges what it thinks are email addresses in order to prevent
harvesting by spammers.
You might find this representation of that message more readable.
http://thread.gmane.org/gmane.comp.shells.bash.bugs/1728/focus=1729
Bob
s not work.
More general than aliases I think shell functions work best.
Something like this following:
n() { nedit "$@" & }
Bob
okay to leave PATH alone to me. Why set it at all?
I don't see the security issue that you are concerned about. Could
you educate me?
Bob
that case. It is only replaced
when it is the first word.
Using aliases in this way seems really warped to me. I would avoid it
for the clarity of code. Aliases are really an old paradigm from csh
days. Functions in more modern shells completely replace the need for
aliases.
Bob
Chet Ramey wrote:
> Bob Proulx wrote:
> > It seems okay to leave PATH alone to me. Why set it at all?
> >
> > I don't see the security issue that you are concerned about. Could
> > you educate me?
>
> I suppose it's not a large security hole if $
#x27; and grep collisions.
grep PATTERN FILE1 > FILE2
Which is why I like to use sed for this instead. Then the exit code
reflects errors and not pattern matches and can be more easily used to
handle errors such as a full disk.
sed -n '/PATTERN/p' FILE1 > FILE2 || exit 1
Bob
need to check. Even if it isn't available (yet) due
to the dependencies you could use it as the basis of a backport to
Lenny.
Bob
mplest and best way to do this.
> for i in ${IPS}
> do
> nmap -p 22 {IPS}
> done
Again using echo here is very useful.
$ for i in ${IPS}
> do
> echo nmap -p 22 {IPS}
> done
nmap -p 22 {IPS}
You didn't have a dollar sign there. But actually you wanted to
say $i instead.
Hope this helps,
Bob
crontab. The 'savelog' command with -c7 will save seven days of
datestamped backups (sufficient for my case) without further code.
That could easily be -c30 to save 30 days worth. The 'savelog'
command pretty much handles all of your issues with datestamping and
cycling files very easily.
30 3 * * * root umask 077 ; mysqldump --defaults-file=/etc/mysql/debian.cnf
--all-databases | gzip > /var/backups/mysql.dump ; savelog -q -d -l -C -c7
/var/backups/mysql.dump
Bob
would think that would be the place to start
to look for problems.
Bob
9-07/msg00107.html
Perhaps you are having a similar problem. Double check the signatures
of the files and ensure that your downloaded patches aren't corrupted
and then I am sure that they can be applied.
Bob
e eight-bit character whose value is the octal value
nnn (one to three digits)
However on that same system this is the behavior:
$ echo -e "\173"
\173
$ echo -e "\0173"
{
I think this was simply a documentation bug that has subsequently been
addressed.
Bob
hen the script doesn't
open the next page. The script simply prints out the html that the
user will see next. Or the script print out a redirect to send the
browser to a different page.
Good luck!
Bob
bash is operating in one mode or the other, and
> how I can explicitly set this behavior one way or the other?
Try invoking bash with the -i option forcing interactive behavior.
Does this change anything?
Bob
but does not include eight or nine.
Please look at the Bash FAQ item E8.
http://www.faqs.org/faqs/unix-faq/shell/bash/
Bob
et "ulimit -a" but to get "ulimit" "-a" instead. You are
seeing the output of "ulimit".
Try this:
ssh localhost "bash -c 'ulimit -a'"
And this:
echo ulimit -a | ssh localhost bash
Bob
oblem.
> > ssh localhost "bash -c 'ulimit -a'"
I should have added the -n option to ssh so that it wouldn't read from
stdin. In the above if used in a script it will read and consume any
input that may have been expected for a different command.
ssh -n localhost "bash -c 'ulimit -a'"
Bob
peter360 wrote:
> Thanks Adreas. That was what I suspected in my reply to Bob. But Bob
> disagreed. Looks like there were some confusion about this feature even
> among experts. Seems another reason to deprecate the feature.
I don't think anything I said disagreed with what And
ams)
aptitude install unison grass
And then if you are sure it is creating the right command for you then
you can invoke it without the 'echo' and run it for effect.
$ sudo aptitude install $(sed 's/#.*//' programs)
Reading package lists... Done
...
(Of course on my systems I spell 'aptitude' as 'apt-get'. But that is
a topic for a different mailing list. :-)
Bob
Marc Herbert wrote:
> Bob Proulx a écrit :
> > > Note that if 'cat' didn't exactly reproduce the contents of input on
> > > the output I would consider that a grave bug.
>
> Well... GNU cat has a number of options, and almost every single one is
&
Pierre Gaston wrote:
> Please consider asking in a sed mailing list like:
> http://sed.sourceforge.net/#mailing
> or maybe in the usenet group comp.unix.shell
I would think help-gnu-ut...@gnu.org would be the better place to ask
for help about GNU utilities. :-)
Bob
Greg Wooledge wrote:
> Bob Proulx wrote:
> > I would think help-gnu-ut...@gnu.org would be the better place to ask
> > for help about GNU utilities. :-)
>
> We don't know that he's using GNU sed.
True, we don't know for sure. But I think it likely that it
st argument. Most of the time
that you are doing something like 'edit filename.c &' then you can use
the still quite convenient M-C-y to paste in the filename as the first
argument to the next command.
Bob
This usage will remove the ambiguity of the command between the copy
> function and the rename function.
Please rephrase your question and send it to bug-coreut...@gnu.org.
Thanks
Bob
essed up; probably because I have
> a very complex bash prompt with colors and all...)
You have probably tripped into bash FAQ number E3. Easy to fix.
Bob
ented.
http://git.savannah.gnu.org/cgit/bash.git
But only at the major release points. No patches have been applied.
But the available history seems to all be there.
Bob
cimal number the leading zeros must be
removed.
$ echo $((8))
8
Note also that the use of $[expression] for $((expression)) is
documented as deprecated and to be removed in a future version.
Better to use $((expression)) instead.
Bob
/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
$ strings /bin/bash | grep /usr/bin
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Bob
different people will be
created differently. That is just the way that it is.
If this is the biggest of your issues then you are in great shape! :-)
Bob
leases and all of the patches
together (the hard part) then I would be willing to put them together
(the easy part) for the version control history. But as you say, then
someone still needs to feed it when new official patches are released.
Bob
you could have it
> pop out whenever the mouse pointer touches the top of the screen.
That seems reasonable suggestion to make to your terminal program
author as a configurable option.
Bob
kernels have removed
this limitation and are limited only by available virtual memory. You
didn't say what kernel you were using. (e.g. 'uname -a')
In any case this FAQ should be useful.
http://www.gnu.org/software/coreutils/faq/#Argument-list-too-long
Bob
es.h Sun Mar 23 00:20:36 2003
@@ -489 +489 @@
-#ifndef __STDC_32_MODE__
+#ifndef __LP64__
As I recall in 64-bit mode all of the strtoull et al routines are
broken without this fix. It might have eventually gotten fixed
upstream in some later 11.x release by this late date but I don't
know. But the problem as reported seems like it may be related.
Bob
ot;tmp" is 3 characters and "y -> tmp"
is 8 characters and that value is displayed in the size field. So
even without knowing the filename to be listed the result can be
parsed to extract the target name.
Bob
d reference to `__strtoll'" (gcc) problem.
To fix this for the native HP-UX C compiler in 64-bit mode make the
same change to the /usr/include/inttypes.h file.
I don't know about the ld core dump though. That shouldn't happen
regardless.
Hope this helps!
Bob
Peng Yu wrote:
> My grep is aliased to "grep --color=auto".
>
> I then use grep "", where is a tab character. But the
> result is not colored. How to make the tabs colored?
You might try asking that question on bug-grep. This is bug-bash and
your issue does not seem to be with bash.
Bob
t to
capture the needed information is preferred.
bashbug
Bob
hen slip in your variable manipulation right there.
for f in *;do FILENAME=${f%.*}; done
echo $FILENAME
Bob
. Instead use
a redirection and no subshell will be created.
#!/bin/bash
echo Start
while read proc
do
echo $proc
exit 1
done < <(ps -ef)
echo Continue
The "<(command)" syntax is documented in the Process Substitution
section of the manual.
Bob
I suggested it for
/bin/bash specifically and not /bin/sh linked to bash. The redirect
syntax would fail if /bin/sh is linked to either a POSIX shell or
Bourne shell.
Unfortunately when porting applications there are no paths available
that don't entail some amount of work.
Bob
Greg Wooledge wrote:
> Bob Proulx wrote:
> > Greg Wooledge wrote:
> > > Migrating FROM something that used Korn shell, I presume? Why not
> > > just install Korn shell and use #!/bin/ksh on your scripts, if you need
> > > to rely on Korn shell features?
>
utils/util-linux-ng/
There is also 'lockfile' distributed with 'procmail'.
http://www.procmail.org/
I tend to use 'mkdir' when I need a semaphore in a shell script.
Bob
Clark J. Wang wrote:
> Bob Proulx wrote:
> > There is also 'lockfile' distributed with 'procmail'.
>
> By using `lockfile' we must make sure that our script will not crash and
> the file is unlocked when the script exits.
True. That is true of
test this and mistakes in your .bash_profile may
prevent bash from starting and thereby preventing you from logging
into the system. You could lock yourself out. Always keep a spare
login handy in order to fix problems.
Bob
of values includes
ignorespace, lines which begin with a space character are not
saved in the history list.
Remove "ignorespace" from HISTCONTROL and it will save commands that
begin with a space too.
Bob
ill change file 1. I'm wondering if there is way to do so,
> > so that I don't have to test whether it is a symbolic link or not
> > explicitly.
>
> rm link1
rm -f link1
The -f will prevent a stat(2) of the target before removal and will
prevent a warning if the target has already been removed or otherwise
does not exist.
Bob
recompiling the program.
A Comment: Symbolic links are designed to be transparent. Normal
programs are not aware of them.
You could probably create an LD_PRELOAD library to intercept file
modification calls and then handle them in your own code. But I think
it would be difficult to do it all completely correctly and not to
introduce bugs. I advise against it.
Bob
tributions making use of GNU bash and packaging it
for others modify that file. You are certainly free to make any
modification there. You don't need an upstream change to do this.
Bob
[[ -s
"$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi' >>
$HOME/$profile done
Note that it is talking about your profile and not your bashrc file.
Bob
y keep different versions (modified at different time) of
No. Copy-on-write filesystems automatically make a copy of your file
when you write to it.
Bob
true | iconv -f ISO_8859-1 -t UTF-8
Beyond this I am not sure what you wanted to do with exec. You may
have wanted this:
exec iconv -f ISO_8859-1 -t UTF-8
Bob
301 - 400 of 510 matches
Mail list logo