Bruce Korb writes:
> Thanks, Eric & Chet. I hope nobody ever needs to load up a set of
> aliases within a Makefile script.
A non-interactive shell does not have aliases.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5
ror token is "$(date)")
>
> That also looks OK.
Here the index is '$x'.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
If you want to write robust scripts, don't use shell.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
ot; which appears as a component in
> the definitions of "pipeline", "list", and "complex command".
A command can be either a simple command, a compound command, or a
function definition, but not a pipeline or a list.
Andreas.
--
Andreas Schwab, SUSE Labs, sch
r for your memory storage.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Tim Friske writes:
> my assumption was that Bash's "printf" builtin implicitly defines a local
> variable when used inside a function like so:
Why? A simple assignment doesn't either, and that's what printf does in
the end.
Andreas.
--
Andreas Schwab
[[ -r foo ]] && [[ -x foo ]] ; then . . .
>
> but
>
> if [[ -drx foo ]] ; then . . .
>
> is a lot easier.
But it is ambigous. Does it mean adjuntion or conjunction?
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 4
shall be recognized as a string operand.
It also says: New applications are encouraged to use printf instead of
echo.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Tim Friske writes:
> set -- "${@:2}"
Aka shift.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
grams that open the
files themselves. It cannot emulate "foo -o /dev/stdin" to make it the
same as "foo >/dev/stdin".
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
>
tty uses stdin, so this is the expected output. Why do you think this
has anything to do with this patch?
$ tty --help | head -n 2
Usage: tty [OPTION]...
Print the file name of the terminal connected to standard input.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key finger
e file was not modified last hour, I want to send an email out to the
> programmer. Any suggestions on the best way to do this?
if test -n "$(find stampfile -mmin +60)"; then
alarm
fi
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraß
trojan30 <[EMAIL PROTECTED]> writes:
> Thank you for your repley. One question, does the alarm command only work on
> the machine it is run on?
alarm is the command you write to send the mail.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Max
Paul Eggert <[EMAIL PROTECTED]> writes:
> Hence Bash can interpret \123 as an octal escape as well, if it so
> chooses, and still conform to POSIX+XSI.
But note that bash interprets -n as an option, which is not compliant with
XSI.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PRO
Paul Eggert <[EMAIL PROTECTED]> writes:
> Andreas Schwab <[EMAIL PROTECTED]> writes:
>
>> But note that bash interprets -n as an option, which is not compliant with
>> XSI.
>
> Bash doesn't claim conformance to XSI, so that's OK as far as Bash is
>
Mihai Barbos <[EMAIL PROTECTED]> writes:
> When IFS is "\n" a single n at the end of a line is dropped.
IFS="\n"
is equivalent to
IFS=n
If you want to set IFS to a single newline character use either
IFS=$'\n'
or
IFS="
"
Andreas.
--
other use of
the backslash results in implementation defined behaviour.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"An
yank-0th-arg should insert /usr/local/bin/perl into the buffer.
M-0 M-. (digit-argument yank-last-arg)
> (2) delete-backward-argument, similar to delete-backward-word, but
> should delete everything
> to the left until the first white space.
C-w (unix-word-rubout)
Andreas.
--
Andreas S
"Com MN PG P E B Consultant 3" <[EMAIL PROTECTED]> writes:
> Wenn you now do echo $e, you should get the following output:
Try echo "$e". Then read about Word Splitting in the Bash manual.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux P
;
> Is this generally possible?
exec 3>&1
stderr=$(command 2>&1 >&3)
exec 3>&-
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53
nificance any more once the
command is parsed, just like shell meta characters resulting from
expansions are taken literally.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 175
Herculano Einloft <[EMAIL PROTECTED]> writes:
> Em (02:25:11), Andreas Schwab escreveu:
>
>>
>>> Hey all,
>>>
>>> $ if $(echo string >/dev/null); then echo true; fi
>>> true
>>>
>>> This should be a syntax error
.script: line 608: syntax error: unexpected end of file
That has already been fixed.
>
> The offending lines (602 thru 607) from spencer1.script are:
The offending line is actually this:
status=`echo '-'| { ${GREP} -E -e 'a\' >/dev/null 2>&1 ; echo $?;
trap '' TERM
> /usr/sbin/crond -l8
This will run crond with SIGTERM set to SIG_IGN.
> Fix:
> Remove that sentence from the documentation?
It's not wrong, just incomplete. See
<http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html>
different
> locations on the screen ( 1 and 2)? I'd like to combine the output of
> a repeating pstree command with an strace at the same time.
Redirect the output of pstree and strace to different windows inside
screen(1).
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuS
.
Only in icanon mode, otherwise it's readline that does the processing.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now fo
Thomas Mellman <[EMAIL PROTECTED]> writes:
> A recent new version of bash has changed the behavior of the
> yank-last-arg command ("_"). Is there a way to revert to the old behavior?
histchars='!^ '
ie. disable the history comment character.
Andreas.
--
A
"Andrew Kezys" <[EMAIL PROTECTED]> writes:
> Is there any command that will kill bash script-assosciated processes
> in a kind way (ie ctrl-c) when the overall script is ended?
Use a trap on EXIT to do any cleanup you need.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL
:" into only "/bin").
>
> Negative. In bash "/bin:" is "/bin" and "." for PATH lookup.
The point is that word splitting does not preserve the empty element at
the end, thus it differs from PATH lookup.
$ (PATH=/bin:; IFS=:; for x in $PATH; do e
RLIST, because the
standard error was duplicated as standard output before the standard
output was redirected to DIRLIST.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B
ion doesn't come into play here, because the braces are
quoted.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED
Dan Jacobson <[EMAIL PROTECTED]> writes:
> $ cat t.sh
> set -ex
> ! true #should stop here but doesn't!?!
RTFM.
`-e'
Exit immediately if ..., unless ... the command's
return status is being inverted using `!'.
Andreas.
--
Andreas
r feature?
>
> $bash --version
> GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
> Copyright (C) 2002 Free Software Foundation, Inc.
>
> $printf 'hello\0there' | { read -d$'\0'; echo $REPLY ; }
^^^
This is equiv
just receives a SIGPIPE, since the process in the
process substitution exits without consuming its input. If you are lucky
the first echo will be faster...
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprin
[EMAIL PROTECTED] writes:
> $ echo $(
> > case a in
> > 1) :;;
> bash: syntax error near unexpected token `;;'
Use (1) instead.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 9040
mwoehlke <[EMAIL PROTECTED]> writes:
> ...but doesn't that mean that '{"x,x"}' should expand as '{x,x}'
It does.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key
mwoehlke <[EMAIL PROTECTED]> writes:
> Andreas Schwab wrote:
>> mwoehlke <[EMAIL PROTECTED]> writes:
>>
>>> ...but doesn't that mean that '{"x,x"}' should expand as '{x,x}'
>>
>> It does.
>
> Huh?
In th
Karen Etheridge <[EMAIL PROTECTED]> writes:
> Tilde expansion is not being performed when variables are being evaluated.
This is how it is supposed to be. Tilde expansion is performed before
parameter expansion, as described in the manual.
Andreas.
--
Andreas Schwab, SuSE Lab
27;m two subshells deep
>DO STILL MORE STUFF
># Now I want to exit
>exit
>exit
>logout
>
> I would like to have a (interactive) command which does the final two
> exits plus
> a logout for me.
exec cleartool
Andreas.
--
Andreas Schwab, SuSE Lab
"Com MN PG P E B Consultant 3" <[EMAIL PROTECTED]>
writes:
> I can't use traps here, because I know only at "exit time", whether
> I want to logout completely, or just go up one level.
$ call_and_exit() { "$@"; if test $? -eq 42; then exit; fi; }
$
`(['
> testcase: line 6: `[[ "${OLDCANDIDATE}" =~
> ([^-]+)-([^-]+)-([^-]+)-0*([1-9][0-9]*)\.tgz ]]'
Parens are special inside [[ ]], you need to quote them.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerp
is zero. Otherwise it will
be truncated at the specified limit, but that does not count holes. The
core file is probable pretty sparse; try running du on it.
In any case this has nothing to do with the shell.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, M
t; outputs newline-delimited result then surely there
> should it should be possibly to have the spaces on each line escaped
> and only the newlines converted to spaces.
Word splitting is controlled by IFS. Use IFS=$'\n' to only split on
newlines.
Andreas.
--
Andreas Schwa
; produces the expected output of '[w]',
Try the same while in /usr/bin.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214
all depends on timing.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something com
displays the changed var1 as being 1. At the
> expense of losing the return value.
You are not using the return value of the function but its output. The
return value of a function is the exit status of the last executed
command, and can also be set with return. The return value is a
t; is used as an offset from the end of the value of parameter."
>
> However, if I use echo ${f:-3} I don't get the expected result.
Read the second last sentence of the paragraph.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfe
Richard Ray <[EMAIL PROTECTED]> writes:
> Other than lsof is there a way to determine what file descriptors are
> open?
$ (exec 4<&$n) 2>/dev/null && echo fd $n is open
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstr
Bruce Korb <[EMAIL PROTECTED]> writes:
> $ echo tpdsrc/umod/nodesvr/test/[a-z]*
> tpdsrc/umod/nodesvr/test/Makefile tpdsrc/umod/nodesvr/test/SCCS
> tpdsrc/umod/node
>
> What are the "Makefile" and "SCCS" entries doing on the line?
Please read the Bash
ing-of-line
> bind -p returns the carbon copy of these two lines,
You have just bound the two character sequences C-\ . and C-\ , to
beginning-of-line.
> but holding down Ctrl-. or , returns nothing.
As long as the terminal does not emit anything distinguishable for these
keys it won't
uses strcoll as well. Most likely python has its own
implementation which gets it wrong.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now
Elmar Stellnberger <[EMAIL PROTECTED]> writes:
> This bug has already been reported for konsole under bugs.kde.org,
> bug#Bug 48109 <http://bugs.kde.org/show_bug.cgi?id=48109>
Read <ftp://ftp.cwru.edu/pub/bash/FAQ>, question E3.
Andreas.
--
Andreas Schwab, SuSE Labs
ecked this behavior and in xterm everything works. Thus seems
> that this is konsole bug and bash works as it should.
Except that is also fails in xterm, or any other terminal.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Ger
Chet Ramey <[EMAIL PROTECTED]> writes:
> I can't reproduce this on Mac OS X, using Terminal or xterm.
I can reproduce it with
GNU bash, version 3.2.9(1)-release (powerpc-apple-darwin8.8.0)
both with Terminal and xterm.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECT
sadvantage that generator and consumer no longer run
concurrently. Process substitution does not have this problem.
while ...; do var=...; done < <(
generate-input-for-while
)
use "$var"
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5
ivalent to the command
in the FAQ:
IFS=. read A B C D < <(/usr/local/bin/ipaddr)
This is actually more efficient since it avoids the extra command
substitution. But both have the same outcome if the output of
/usr/local/bin/ipaddr has no more than 4 dots.
Andreas.
--
Andreas Schwab, SuSE La
cted.
> Regardless, is there a simple solution to get the behavior I want?
You need to enable job control and kill the whole job.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnb
Jeff Weber <[EMAIL PROTECTED]> writes:
> enable job control,
$ set -m
> and kill the entire backgrounded job from a second
> non-interactive script?
You send the signal to the process group.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH,
nteractivity
and job control are orthogonal concepts.
> If the process group of the background job could be returned or queried when
> the background job is launched,
That's what $! is for.
> Please let me know if I am misunderstanding, and thanks for your help.
Don't top post.
Jeff Weber <[EMAIL PROTECTED]> writes:
> (/bin/kill is required. The bash builtin kill cannot kill
> an entire process group.)
Sure it can.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key finger
e history. Its
only function is to automatically offer a line with a failed history
substitution for reedit.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B
if read returns -1 then this writes beyond array bounds.
Also, file_size is size_t, but result is only int.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 4
as small as 32k. I guess I've never tried to source an autoconf configure
> script on such a system.
If your ssize_t is smaller than 32 bits you'll have to worry about more
things than that.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße
Matthew Woehlke <[EMAIL PROTECTED]> writes:
> Hmm... well then I guess this is broken:
> /usr/include/limits.h:#define SSIZE_MAX53248/* max single I/O
> size, 52K */
The creativity of system designers always amazes me. :-(
Andreas.
--
Andreas Schwab, Su
;$A more"
> echo $A , $B
> should display moo twice or just once:
> moo , moo more
> moo , more
"Each variable assignment shall be expanded [...] prior to assigning the
value."
That means that each assignment is supposed to be expanded _and_ performed
in the same step
Peter Volkov <[EMAIL PROTECTED]> writes:
> Steps to reproduce:
> PS1="\e[36m[\e[34m\u\e[0m \e[32m\w\e[36m] \\$\e[0m "
This is broken. You need to bracket escape sequences with \[ \].
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH,
n).
>
> I can't reproduce this with bash-3.2.15 and Fedora Core 5 in a Parallels
> VM, with the Home key bound to beginning-of-line.
Perfectly reproducible with bash 3.2.15 and TERM=xterm, see the attached
typescript. Note the bogus 20 ^H after the prompt is redrawn.
Andreas.
--
An
Chet Ramey <[EMAIL PROTECTED]> writes:
> I simply cannot reproduce it on the systems I have available.
You need to be in a multibyte locale.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerpri
Chet Ramey <[EMAIL PROTECTED]> writes:
> Andreas Schwab wrote:
>> Chet Ramey <[EMAIL PROTECTED]> writes:
>>
>>> I simply cannot reproduce it on the systems I have available.
>>
>> You need to be in a multibyte locale.
>
> I used en_US
ershoot happens after end of isearch, no matter how you leave
it.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something
Chet Ramey <[EMAIL PROTECTED]> writes:
> OK, I'm stumped.
Try again with PS1='\[\033[01;31m\]12345\[\033[01;34m\] \W \$\[\033[00m\] '.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key
[EMAIL PROTECTED] writes:
> Description:
> Result of "( false )" is 0, should be 1
This is not the case. The exit code is correct, but only simple commands
are causing the shell to exit with set -e. A subshell is not a simple
command.
Andreas.
--
Andreas Schwab, S
> acters special to other expansions are preserved in the result. It is
> strictly textual. Bash does not apply any syntactic interpretation to
> the context of the expansion or the text between the braces."
If it would be done strictly textual, the resulting expansion would
act
Lucas Nussbaum <[EMAIL PROTECTED]> writes:
> Well, no, because bash expands *parameters*, not words. So the prefix is
> "<(cat /etc/", and the suffix is ")".
But that would not be a *strict textual* expansion.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL
Eric Blake <[EMAIL PROTECTED]> writes:
> According to Andreas Schwab on 4/18/2007 4:01 AM:
>> Lucas Nussbaum <[EMAIL PROTECTED]> writes:
>>
>>> Well, no, because bash expands *parameters*, not words. So the prefix is
>>> "<(cat /etc/&qu
do
> echo "data=$data"
> mplayer "inexistant-file.avi" 2>/dev/null 1>&2
Most likely mplayer is reading from stdin. You should redirect its input
to avoid that.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Produ
s aborted).
> If bash were to be consistent, then it should display no error message in
> the case of $((3+078));
This is a syntax error, so there is no sensible meaning attached to it. A
syntax error is something quite different than an undefined behaviour.
Andreas.
--
Andreas Schwab, SuS
27;s done in assembly. In C, it's somewhat more
> compilcated. For example:
> 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.
Andreas.
--
An
ou want.
>
> $ sed --in-place $SEDCOMMAND $SOMEFILE
>
> This is available in sed version 4 and later.
Or use ed.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B
[EMAIL PROTECTED] writes:
> Fix:
> The problem lies in the parser somewhere,
The problem is that you are not correctly quoting. Better use $(...)
instead of `...`, that is easier for beginners to get right.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Pr
000 0a
> $ printf "\n" | wc -c
> 1
>
> But when this is used with a command substitution the newline
> disappears.
Command substitution always strips trailing newlines.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeld
of a special
built-in utility, that special built-in utility shall be
invoked.
(And set is a special built-in.)
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
nt "0.net" always be displayed ? looks like A is always set properly
> to "0.net", but in the first statement, $A gets expanded before the variable
> assignments are processed
See
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01>.
ting.
> /usr/bin/java -cp '"/path/to/classes"' com.choicestream.foo
> But it will display:
> /usr/bin/java -cp "/path/to/classes" com.choicestream.foo
There is no difference between the versions, the executed command is
always the same. If you wa
"Poor Yorick" <[EMAIL PROTECTED]> writes:
> The syntax I'm currently using to access the last element of an array looks a
> little evil:
>
>>arr=( one two three )
>>echo ${arr[$(([EMAIL PROTECTED]))]}
At least you can leave out the $((...)) construct
interval$i=$(($date2 - $date1)) #1st & 2nd errors
If you want to set a computed variable you need to use eval.
eval interval$i='$(($date2 - $date1))'
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409
Chet Ramey <[EMAIL PROTECTED]> writes:
> Nic James Ferrier wrote:
>> Using bash 2.05, does anyone know of a way to get a trace of what's
>> happening inside a function?
>
> Only by adding `set -x' inside the function body.
Or by upgrading to a shell
ortunately there have been "dot files" in the user profile and so I tried
> this command to catch them:
>
> chmod -R $USERNAME .*
You could have just used "." as the argument. Saves a key. :-)
> Another example: How would I kill all files on a mounted removable media
U+1E0A. This works correctly with current versions of
xterm or konsole.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
t; echo $?
>
> shows syntax error.
true and false are not numbers. The OP was talking about expression
evaluation.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756
You either
want --bindir=/bin or --exec-prefix= (ie. empty).
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And n
gt; $ echo $((foo))
> bash: 12
> 34: syntax error in expression (error token is "34")
Why do you think this is a bug? Two numbers separated by whitespace
cannot form a valid expression.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux P
dAniel hAhler <[EMAIL PROTECTED]> writes:
> 1. Set PS1="\033[01;37m[ \[\033[01;34m\]\w\[\033[00m\]
> \033[01;37m]\n\$\033[00m "
You need to bracket _every_ nonprinting sequence of characters with \[\].
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
Su
command's
return status is being inverted using `!'. A trap on `ERR',
if set, is executed before the shell exits.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 5
if ((${?}!=0)) # <--- ${?} is zero here not 127 ?
The variable is already substituted while the here-document is read.
Either quote the dollar sign, or use a quoted here-document.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409
he 3 characters
>> '!', I have to do something like echo "'"'!'"'" whereas true
>> escaping would allow the more readable echo "'\!'"
$ echo \'\!\'
Since ! is an interactive only feature there is not m
Bernd Eggink <[EMAIL PROTECTED]> writes:
> t0nedef schrieb:
>
>> echo "Please enter a network name"
>> read ESSID
>> if [ -n $ESSID ]
>
> You probably meant:
> if [ -z $ESSID ]
Really you want this:
if [ -z "$ESSID" ]
Andreas.
ironment variable not show
> up?
A setuid binary ignores LD_LIBRARY_PATH for security reasons.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
&quo
cho b > a' | :
bash: line 0: echo: write error: Broken pipe
and the file contains only one line.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Stephane Chazelas <[EMAIL PROTECTED]> writes:
> That was on Linux, glibc 2.6.1.
Same.
Andreas.
--
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
301 - 400 of 818 matches
Mail list logo