Vincent Lefevre vinc...@vinc17.org wrote:
I get the following errors with bash 3.2.39 under Debian/unstable:
bash -c 'alias a=echo OK 2
a
/dev/null a'
bash: line 1: a: command not found
bash: line 2: a: command not found
aliases aren't expanded by a non-interactive bash by default. If
Jon Seymour jon.seym...@gmail.com wrote:
If the builtin echo fails it will be because the bash interpreter has
suffered a catastrophic failure of some kind [ e.g. run out of memory
]. Once that has happened, all bets are off anyway.
Probably true, but command substitution forks a separate
Jon Seymour jon.seym...@gmail.com wrote:
On Mon, Feb 16, 2009 at 10:22 AM, Paul Jarc p...@po.cwru.edu wrote:
CPATH=${CPATH:+$CPATH:}${#+~usr1/blah/blah}
Out of interest, how does one derive that outcome from the documented
behaviour of bash? That is, which expansion rules are being invoked
Angel Tsankov fn42...@fmi.uni-sofia.bg wrote:
How do you know that $# is always set? And what about $...@? To what values
are these parameters set outside any function?
$# gives the number of positional parameters. If there aren't any
positional parameters, then it's set to 0. In the man
Jon Seymour jon.seym...@gmail.com wrote:
The manual specifies a rule for ${parameter:+word}, but not
${parameter+word}.
It's there, but easy to miss:
In each of the cases below, word is subject to tilde expansion, parame-
ter expansion, command substitution, and arithmetic
tal396 tal...@gmail.com wrote:
Coz its could be find in alot of subdirs
like
/home/server/backups/local_backups/1-1-2009/server/mysql/1-1-2009.sql
/home/server/backups/local_backups/1-2-2009/server/mysql/1-2-2009.sql
/home/server/backups/local_backups/1-3-2009/server/mysql/1-3-2009.sql
This
Mike Frysinger vap...@gentoo.org wrote:
the op wasnt asking for the time, they were asking for the last created file.
and the ls man page talks how to sort by ctime.
ctime is the time when the inode was last modified, not (necessarily)
the time when the file was created.
paul
Ronny Standtke ronny.stand...@fhnw.ch wrote:
The -n option not seem to work. Example with a little stupid nonsense
script:
---
ro...@ronny-desktop:/tmp$ cat test.sh
#!/bin/sh
if [ $blah == test]
This sort of error can't be caught by -n, because it's part of a
specific command, not
Michael Rendell mich...@cs.mun.ca wrote:
local x=$( echo hi; exit 20);
ret=$?
Here you're getting the exit status of local itself, which is 0. If
you want the exit status of the command substitution, make that a
separate command:
local x
x=$( echo hi; exit 20);
paul
Simos simos.li...@googlemail.com wrote:
alias -- ../='cd ..'
alias -- .../='cd ../..'
alias -- /='cd /'
You can do those as shell functions:
../() { cd ../; }
.../() { cd ../..; }
/() { cd /; }
2. An issue with PS1 is that there is no \w or \W version that can
expand the ~. My aim is to get
Matthew Woehlke mw_tr...@users.sourceforge.net wrote:
Actually, a feature that would be REALLY helpful is a way to specify
certain directory strings that should be abbreviated.
PS1='...$(mypath)...'
mypath() {
case $PWD/ in
/usr/local/src/kde/svn/trunk/*)
printf %s
Martin Schwenke mar...@meltin.net wrote:
Neither bash.info or bash(1) documents parameter expansion of the
form:
${parameter+word}
It's documented, but it's easy to miss. Just before the list of
parameter expansion forms is this paragraph:
In each of the cases below, word is
men8th t...@avacta.com wrote:
t...@ggeom:/usr/local/SunStudio12ml-linux-x86-200709-ii/sunstudio12/prod/bin$
./CC
bash: ./CC: No such file or directory
However, the file clearly is there. Here is an extract of ls -l
The problem could be that CC is a script, and the interpreter on its
#! line
Dolphin06 [EMAIL PROTECTED] wrote:
Can i do something like this :
ssh [EMAIL PROTECTED] export PATH=$PATH:/other path/ ; script param
You'd have to quote the sequence of commands that should run on the
remote host, so that the local bash and ssh see it as all one parameter:
ssh [EMAIL
Bob Proulx b...@proulx.com wrote:
Also, using full paths is frowned upon.
You mean invoking /directory/some-command directly instead of
PATH=$PATH:/directory
some-command
? It depends on the situation. If you think some-command is in
/directory, but you want to allow for the possibility that
AT-HE [EMAIL PROTECTED] wrote:
if you have a simlink pointing to a directory, chdir to that symlink
dir, and type something with '..',
you access the parent of real directory, not previous simlinked one.
That's the kernel's doing, not bash's. When interpreting pathnames
Thiemo Kellner [EMAIL PROTECTED] wrote:
Maybe the piping converts the block implicitly to a subshell.
Yes, it does. This is documented in the man page, under Pipelines
in the SHELL GRAMMAR section, and in the FAQ, entry E4.
paul
[EMAIL PROTECTED] wrote:
regular expression are broken in 3.2.39
It's not broken; it's different. See entry E14 in the bash FAQ, and
check out the compat31 option in shopt.
paul
Marcin Owsiany [EMAIL PROTECTED] wrote:
On Mon, Oct 06, 2008 at 09:22:30AM -0400, Chet Ramey wrote:
This bug only occurs when errexit is enabled and the final element of a
pipeline is a simple command that returns a non-zero exit status.
Well, if the final element in the pipeline is a simple
mikehershey32 [EMAIL PROTECTED] wrote:
Is there a way that i can make new output to the file overwrite the
old file content without stopping the program and restarting the script or
rotating the log file?
{
python -c '
import os
import time
while True:
time.sleep(1)
os.lseek(1, 0, 0)
'
Chet Ramey [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Is this a bug?
$ t=test #bash builtin
$ $t -t ' '; echo $?
0
Doesn't look like it:
I think it is a bug, but libc may or may not hide it, depending on the
strtol[l] implementation. SUS says:
# If the subject sequence is empty
[EMAIL PROTECTED] wrote:
On (info (coreutils)File type tests, and test(1) man page, we see
`-t FD'
True if FD is a file descriptor that is associated with a terminal.
Well please mention what happens if FD is omitted:
bash's help test explains this, if you know where to look:
Keshetti Mahesh [EMAIL PROTECTED] wrote:
I followed the syntax properly.
But thats not the problem. Problem is how long can the concatenated
string can be ?
If it's too long to fit in that command line, you could pass it this
way:
sed -f (echo 's/old1/new1/;s/old2/new2/...')
paul
Geoff Kuenning [EMAIL PROTECTED] wrote:
BASH_ENVis the cracker's delight. Any setuid program that
invokes a Bash script, even indirectly, is completely
open to attack.
Nope. Look at the -p option for set. BASH_ENV can be used to cause
scripts to go
christophe malvasio [EMAIL PROTECTED] wrote:
cbz (){ echo why 'cbz' not a valid function name ?;}
bash: syntax error near unexpected token `('
It works for me. What does alias cbz say for you?
paul
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote:
Chet Ramey wrote:
This is from the man page, in the QUOTING section:
No idea about that. GNU project folks are well-known for deprecating man
pages. I go by the reference manual
http://www.gnu.org/software/bash/manual/bashref.html.
That document
Richard Neill [EMAIL PROTECTED] wrote:
the aim is to parse the output of ffmpeg -formats to see whether
certain codecs are supported by that build.
I'd use something like:
while read line; do
...
done (ffmpeg -formats 2/dev/null)
That puts ffmpeg into a subshell instead of read.
paul
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote:
Chet Ramey wrote:
I already explained that bash follows csh as closely as possible
in its history expansion implementation.
Well, it doesn't:
Sure it does: in your examples, bash tries history expansion in
exactly the same cases as tcsh. Where
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote:
It's not going to break any executable scripts, since it has already
been pointed out to me that history expansion doesn't happen in
scripts.
History expansion doesn't happen in scripts *by default*, but it can
be enabled explicitly.
paul
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote:
pk wrote:
This is documented in man bash, and only happens in interactive shells (not
scripts).
I just tried putting my six cases into a script, and I get exactly the same
sort of output as interactively.
How did you invoke the script? If you do
Marco [EMAIL PROTECTED] wrote:
I couldn't find any information on it, but I'm noticing alias expansion
is not happening in non-interactive mode within a function with
expanded_aliases turned on. Is this a know problem, or am I missing
something?
Felix Schwarz [EMAIL PROTECTED] wrote:
I'm not able to specify an interpreter in a shebang line if the path
to this interpreter contains spaces.
It's actually the kernel that interprets that line, not bash. The
historical behavior is that space separates the interpreter from an
Jan Schampera [EMAIL PROTECTED] wrote:
Stephane Chazelas wrote:
Note that bash didn't have to. POSIX allows a shell to accept
any character in a function name, but it says one shouldn't use
those in a POSIX script, which is different.
I'm not a POSIX expert, and this is the SUS, but I read:
luiscolorado [EMAIL PROTECTED] wrote:
This is what I get when some file names have spaces:
for i in `my-program`
do
echo $i
done
It echoes the following:
sony
apple
hewlett
packard
Unquoted `` expansions are split into words using $IFS. So if you
only want to split on newlines:
João Abecasis [EMAIL PROTECTED] wrote:
$ PS1='\e[0;[EMAIL PROTECTED] \W]$i\[\e[m\]'
See entry E3 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ
paul
João Abecasis [EMAIL PROTECTED] wrote:
$ PS1='\e[0;[EMAIL PROTECTED] \W]$i\[\e[m\]'
Sorry, ignore the previous message - you're missing \[ before the
first escape sequence.
paul
Linda Walsh [EMAIL PROTECTED] wrote:
echo ${{f##*/}%$ext} (but: -bash: ${{f##*/}%$ext}: bad substitution)
Do I need to use an intermediate variable
Yes. Unfortunately, the expansion operators work directly on
variables - not on arbitrary strings which may contain other
expansions.
paul
John Smith [EMAIL PROTECTED] wrote:
echo foo | read VAR
echo $VAR
See entry E4 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ
paul
Charlse Darwin [EMAIL PROTECTED] wrote:
i.e. How do I get the latest to be the login shell?
You could add exec bash as the last command in ~/.bash_profile.
paul
Brian J. Murrell [EMAIL PROTECTED] wrote:
It is a shame for this particular reason that head does not (perhaps as
an option) consume it's input after displaying the 20 lines.
You can do that with sed:
... | sed '21,$d'
paul
Erik-Jan Taal [EMAIL PROTECTED] wrote:
Now watch the terminal where the script was still running. I would
expect no output to be given, as I assumed the script is read into memory
at startup and not during execution and this is what happens on most
systems. On one server however, the 'bla' is
Linda Walsh [EMAIL PROTECTED] wrote:
The longest matching substring (because you use / to start the pattern,
yes?)
No, !() normally uses the longest match, just like *, *(), and +().
s=thomas rich george
Manpage says !() will match anything except one of the patterns.
$s is 1
Linda Walsh [EMAIL PROTECTED] wrote:
p=-e -p 60 -x
---
That's why I wanted the capture -- to pick out the 60 -- where 60 represents
a positive integer. The space between the -p and the number is optional.
It sounds like you're looking for getopt.
paul
Linda Walsh [EMAIL PROTECTED] wrote:
# *1 - using -e stops your script immediately on any error
Not any error - only those from simple commands. The subtleties are
subtle enough that I avoid -e, and use between all commands
instead.
paul
[EMAIL PROTECTED] wrote:
$ unset fu~
bash: unset: `fu~': not a valid identifier
You can use unset -f to unset a function whose name doesn't fit the
rules for variable names.
paul
Heinz-Ado Arnolds [EMAIL PROTECTED] wrote:
a=111.1
echo ${a//[0-9]/x}
correctly gives xxx.x, but
echo ${a//[0-9]/*}
gives a listing of files in current directory. Seems that the *
is expanded before replacing the pattern.
No, it's expanded afterward, because the
Jesse Molina [EMAIL PROTECTED] wrote:
Basically, on the two troubled systems, my interactive shell will
hang after I've disowned a process. On one other system, everything
works as expected. I expect that a disowned process should not hang
logout -- disowned means disowned.
The terminal
Horinius [EMAIL PROTECTED] wrote:
Paul Jarc wrote:
Read entry E4 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ
I've read several times that section but I'm not sure how to use the IFS.
IFS is only useful if you're splitting the fields of the line into
separate variables
[EMAIL PROTECTED] wrote:
./doit: line 29: exec: 3: not found
This is the line where i try to open the file descriptor
for input:
exec ${fd}$inf
Try this:
eval exec ${fd} '$inf'
And likewise, when closing the descriptor:
eval exec ${fd}-
paul
Horinius [EMAIL PROTECTED] wrote:
Is there any pitfall using this solution of yours? You talked about
regular file, what's that supposed to be? Text file vs binary file?
No, just that it doesn't work for pipes, so the data you're reading
has to be in a named file, not produced as the output
Horinius [EMAIL PROTECTED] wrote:
cat test.txt |
while read line
Read entry E4 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ
paul
bengoavs [EMAIL PROTECTED] wrote:
CMDS=(ls -l /tmp/log)
~/child.sh ${CMDS[0]}
child.sh:
for i in $@
do
if [ $i ]; then
echo $i
$i
Redirections and other special characters are not treated specially if
they are produced by a variable expansion. In
TimtheEagle [EMAIL PROTECTED] wrote:
main_auth=7
f=main
t=auth
ile=$f_$t
echo $ile
Either: echo ${!ile}
Or: eval echo \\$$ile\
paul
hirochiamaru [EMAIL PROTECTED] wrote:
I saw it on a screen shot once, but this gentlemen was able to put the bash
prompt at the bottom of his xterm window with out fill the top portion the
xterm window first.
yes '' | head -n $LINES
paul
[EMAIL PROTECTED] wrote:
foo=
[ -n ${foo} ] echo true
Prints true.
That's the correct behavior.
Should probably print an error, since after the command is
expanded there are only three arguments, so the final ] should
be interpreted as the argument to
Jérémy Hervé [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED]:/usr/bin# httpd -v
-bash: /usr/sbin/httpd: No such file or directory
hash -r will fix that. See help hash and man bash for details.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
[EMAIL PROTECTED] wrote:
My claim is that in the attached script, the 'false' command should
*not* be considered to be a part of the list.
Nevertheless, it is. The current behavior is too well-entrenched to
change it, so the most reliable way to get the behavior you want is to
[EMAIL PROTECTED] wrote:
XXX=10; { XXX=20; } | read; echo $XXX
It's clear that 'read' is executed as an separate process and its
result (REPLY variable value) is lost but 'XXX=20' command is done by
the same process as 'XXX=10'.
No, every element of a pipeline is executed in its own
Matthew Woehlke [EMAIL PROTECTED] wrote:
Stephane Chazelas wrote:
[ -n $foo -a -n $bar ]
is not the expression to test whether both $foo and $bar are
non-empty, as it would fail for some specific values of $foo or
$bar (try it when $foo contains = for instance).
Huh? Why would having an '='
raner [EMAIL PROTECTED] wrote:
The completion seems to work, but I do not receive the completed filename
from the shell's stdout.
It's written to stderr, not stdout.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
[EMAIL PROTECTED] wrote:
A variable set inside a while loop loses its value if
the while loop is piped to a command, e.g., sed.
This is normal. Read entry E4 in the bash FAQ.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Chet Ramey [EMAIL PROTECTED] wrote:
Anchored pattern matches that specify removing or replacing each match
don't make sense. The combination is meaningless.
It seems meaningful to me, but since only one occurrence could match
an anchored pattern, every match just means the same thing as the
Matthew_S [EMAIL PROTECTED] wrote:
Can i have something like;
if
difference between dates 5seconds
echo fail
fi
date1=`perl -e 'print time()'`
...
date2=`perl -e 'print time()'`
interval=`expr $date2 - $date1`
if test 5 -gt $interval; then
echo fail
fi
On some systems, you could also
[EMAIL PROTECTED] wrote:
Specifying the key combo shift+tab is not documented.
Your terminal program probably doesn't distinguish tab from
shift+tab. To check, try running od, and type tab, enter, shift+tab,
enter, and see if od prints the same codes for both.
paul
matte [EMAIL PROTECTED] wrote:
The count would be sufficient, as each folder will always hold ONLY these
archives, and no hidden files.
Thus, my directory would be:
myArcName_1.tar.gz
myArcName_2.tar.gz
myArcName_3.tar.gz
This will do it, starting the numbering at 0:
set
Richard Neill [EMAIL PROTECTED] wrote:
I thought testing for overflow was quite simple?
Isn't it just a case of looking at the carry-bit, and seeing whether it
gets set?
That's usually how it's done in assembly. In C, it's somewhat more
compilcated. For example:
result=a*b;
if (result/a!=b)
Andreas Schwab [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Paul Jarc) writes:
result=a*b;
if (result/a!=b) { report overflow; }
That won't work, since (signed integer) overflow is undefined in C. A
compiler is allowed to optimize the condition to false.
Right, operations would have
homac [EMAIL PROTECTED] wrote:
cat test.txt | while read s l ; do
Read entry E4 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
Caleb Cushing [EMAIL PROTECTED] wrote:
the line
FEATURES=parallel-fetch ccache distlocks# userfetch userpriv usersandbox
I was told my bug is not a bug because there was no space in between the #
putting a space does fix the problem but I can't recall that I've ever seen
any documentation
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] ~ $ hello=hello; echo ${hello:-1}
Read entry E12 in the bash FAQ.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
Andreas Schwab [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Paul Jarc) writes:
while ...; do var=...; done EOT
$(generate-input-for-while)
EOT
use $var
This has the disadvantage that generator and consumer no longer run
concurrently. Process substitution does not have this problem.
True
Chet Ramey [EMAIL PROTECTED] wrote:
In my opinion, if a system vendor chooses to enable that sort of
functionality (and many do, for all sorts of reasons), then they
need to add something to the documentation noting that.
Could that be done automatically by ./configure when this is enabled?
Gurjeet Singh [EMAIL PROTECTED] wrote:
1$ cat setenv.sh
#!/bin/sh
alias llrt='ls -lrt'
...
5$ . ./setenv.sh llrt . ./unsetenv.sh
sh: llrt: command not found
Aliases are expanded when a command is read, not when it is executed.
The entire chain of commands forms a single compound command,
Brian J. Murrell [EMAIL PROTECTED] wrote:
(cat $file)
http://partmaps.org/era/unix/award.html
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
snowcrash+bugbash [EMAIL PROTECTED] wrote:
CMD=$GPG --output revoke.txt --gen-revoke $ME
/usr/bin/expect -c \
spawn `$CMD`;\
stty -echo;\
expect 'Create a revocation certificate for this key? (y/N) ';\
send 'y\n'
You have backticks around $CMD. That means bash will run the gpg
Paul A. Clarke [EMAIL PROTECTED] wrote:
The man page states, for the -c option:
-c string If the -c option is present, then commands are read from
string. If there are arguments after the string, they are
assigned to the positional parameters,
agl [EMAIL PROTECTED] wrote:
PS1=$'\[\e]2;\]\h\[\a\]\h:\w \u\$ '
Try this:
PS1=$'\[\e]2;\h\a\]\h:\w \u\$ '
The first \h doesn't move the cursor position, so it should be kept
within \[ and \] along with the escape sequences.
paul
___
Bug-bash
Markos [EMAIL PROTECTED] wrote:
You said that line
cd $path
should be better with quotes to avoid problems with dir names containing
spaces, so did you mean this?
cd $path
Yes.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Markos [EMAIL PROTECTED] wrote:
#Delete logo_1.gif string from every line in results_1,
#leaving only the path to prepare for cd step
sed 's/logo_1.gif//' /tmp/results_1 /tmp/results
This would be more precisely expressed as:
sed 's:/logo_1\.gif$:/:' /tmp/results_1 /tmp/results
If you happen
Nathan Coulter [EMAIL PROTECTED] wrote:
My real goal is to feed data to a function and then source it:
$ cmd_print () { mkfifo zout ; (cat - zout ) ; source zout ; rm zout; }
$ cmd_print EOF
$ date
$ EOF
$
As Andreas said, this will be problematic using a fifo. You could do
it with a
Com MN PG P E B Consultant 3 [EMAIL PROTECTED] wrote:
But it seems that within a $(...), even shell functions are executed
in a child process. Is this supposed to work that way?
Yes. $() passes the output of the inner command to the outer shell
via a pipe, with the inner command running in a
Chet Ramey [EMAIL PROTECTED] wrote:
Hardcoding `/bin/test' is a tricky business:
How about (exec test ...)? Or env test ...?
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
mwoehlke [EMAIL PROTECTED] wrote:
And since when does '#! /bin/bash' mean use whatever 'bash' you
find in $PATH? Silly me, I thought it meant use '/bin/bash'.
Dave did say hash-bang, but he didn't say #! /bin/bash. Possibly
he's thinking of #!/usr/bin/env bash, which should do what you want.
Karen Etheridge [EMAIL PROTECTED] wrote:
Tilde expansion is not being performed when variables are being evaluated.
That's normal, documented behavior. man bash, EXPANSION:
The order of expansions is: brace expansion, tilde expansion,
parameter, variable and arithmetic
mwoehlke [EMAIL PROTECTED] wrote:
I am trying to figure out how to run a command and pipe the output
through tee, and then check the status of the original command.
This uses a bash-specific feature:
cmd (tee file); status=$?
This should work on any sh:
exec 31 status=`exec 41 { cmd; echo
Chet Ramey [EMAIL PROTECTED] wrote:
Vasily Tarasov wrote:
I suppose I've found a bug;
I need to make this part of the FAQ. The `:' is special to readline: it
splits words for the word completion code.
That explains some of what's going on in this case, but not all. For
the first tab,
Chet Ramey [EMAIL PROTECTED] wrote:
Chet Ramey [EMAIL PROTECTED] wrote:
Also, after two tabs, we have qwe:qwe:o, but further tabs don't add
any more qwe:'s for some reason I don't understand.
Because the colon is still a word break character, and readline passes `o'
to the completion
Lorenzo Viali [EMAIL PROTECTED] wrote:
eval \$CMDFILE\ $list
because i need $CMDFILE to receive more than
one argument; but what happens is that if in the
script's option's arguments, there are substrings like
$i, those variable are expanded
That will also happen within
Ilya N. Golubev [EMAIL PROTECTED] wrote:
If `0:0', `0i', `0.tar' files exists in current directory, `0:' is
completed with `0\:0' to obtain `0:0\:0'.
Using 3.0.16 or 3.1.17, only 0 is added by completion for me. So I
end up with 0:0, and further TABs show me the three possible
matches. What
Jaqui Greenlees [EMAIL PROTECTED] wrote:
In a recet discussion about ssh, the ida was put forth
to get opnssh to export a variable that defines the
authentication method used. The idea being to limit
access to su use to only those authenticating through
a public / privat key pairing.
is
Nathan Coulter [EMAIL PROTECTED] wrote:
cat 0 | xargs -0 -n2 bash -c '
This is beside the point, but 0 is a no-op and be removed. Same
for cat |.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Kartik K. Agaram [EMAIL PROTECTED] wrote:
I conclude that the 'logical path' is maintained only by the shell, not in
the filesystem. If I'm right, then the whole notion of logical path is a
leaky abstraction honored only by 'cd -L' (are there any others?). I would
really like to be
Mike Frysinger [EMAIL PROTECTED] wrote:
this little bit of code doesnt work right:
foo() { echo ${1:-a{b,c}} ; }
Brace expansion happens before parameter expansion (man bash,
EXPANSION). So the first } ends the parameter expression, and the
second } isn't special. The result of parameter
Greg Schafer [EMAIL PROTECTED] wrote:
#!/bin/sh
set -e
func () {
false echo false
true echo true
false echo false
}
func
echo done
It never echoes done because func() returns 1.
That's the correct behavior. The last false within the function
does not immediately cause
Greg Schafer [EMAIL PROTECTED] wrote:
Thanks for trying to clarify it for me. Let me put it another way: If I
change Line 1 above to an if/then style statement instead of ie:
if false; then echo false; fi
it works exactly like I'd expect instead of the counter-intuitive behavior
when
Nico Schottelius [EMAIL PROTECTED] wrote:
Please remove the need for -e and ignore -e for a some time, until
it vanished from user programs.
There is too much variation among implementations of echo to ever
hope for uniformity. Different implementations all react differently
to options
Mårten Segerkvist [EMAIL PROTECTED] wrote:
i. e. being able to split a one-liner like:
command1 command2 command3
into several, separate command lines:
You can write that one-liner on multiple lines:
command1
command2
command3
paul
___
John Wenker [EMAIL PROTECTED] wrote:
The following construct _always_ evaluates true, regardless of
whether the file exists or not.
if [ ! -a file ]; then
echo This line always prints no matter what.
else
echo This line never prints.
mwoehlke [EMAIL PROTECTED] wrote:
I *know* '! [ -a file ]' is not portable. I tried to use it in some
script, somewhere, at some time, and it was sometimes treated as history
expansion.
Quoting the ! would take care of that particular problem, but there
are some older shells, like Solaris
mwoehlke [EMAIL PROTECTED] wrote:
Poor Yorick wrote:
The following line does not perform the echo command.
: ${FAKEVAR?} || echo hello
What you probably want is:
[ $FAKEVAR ] || echo hello
That doesn't distinguish between an unset variable and a variable set
to an empty value. If that
1 - 100 of 147 matches
Mail list logo