Re: unexpected exit code for integer operation

2021-10-28 Thread Toralf Förster
On 10/27/21 10:09 PM, Kerin Millar wrote: This is to be expected. It works the same way as in other languages, such as C. You should use the operator that reflects your intent. Understood - thx for the explanation. -- Toralf

unexpected exit code for integer operation

2021-10-27 Thread Toralf Förster
Hi, expected: $ i=0; ((i = i + 1)); echo $? 0 expected: $ i=0; ((++i)); echo $? 0 unexpected: $ i=0; ((i++)); echo $? 1 i is always set to 0, the result is always non-zero, but the return code differs. More info: a stable hardened Gentoo Linux: $ bash --version GNU bash, version 5.1.8(1)-

Re: feature request: allow shif [n] with n > $#

2019-04-13 Thread Toralf Förster
On 4/13/19 9:42 AM, Toralf Förster wrote: > Yep - thx! Except, that I used the opposite: min_days=${1:-5} min_hours=${2:-12} min_compl=${3:-3500} shift "$(( $# < 3 ? $# : 3 ))" setupargs="$@" -- Toralf PGP C4EACDDE 0076E94E

Re: feature request: allow shif [n] with n > $#

2019-04-13 Thread Toralf Förster
On 4/13/19 3:54 AM, konsolebox wrote: > > shift "$(( n < $# ? n : $# ))" Yep - thx! -- Toralf PGP C4EACDDE 0076E94E

feature request: allow shif [n] with n > $#

2019-04-11 Thread Toralf Förster
Given: $> cat >${@}<<" EOF then a call with less than 3 parameter, eg. "./shift.sh 1 2" gives ">>1 2<<". Whilst the man page does not deny this behaviour I do wonder if a feature request to get ">><<" instead is sufficient here? -- Toralf PGP C4EACDDE

autocompletion won't work for file names cotnaining an "@" like /tmp/@world.history

2018-03-16 Thread Toralf Förster
tested at a hardened stable Gentoo Linxu with 4.4_p12. Other devs reported that autocompeltion won't work too in a construct like "cat $(cat somefil" I'm however unsure if this is a bug or a known feature ? -- Toralf PGP C4EACDDE 0076E94E signature.asc Description: OpenPGP digital signature

Re: test for "command not found" before expanding shell parameters

2014-04-20 Thread Toralf Förster
On 04/20/2014 07:58 PM, Alan Young wrote: > greo=$(command -v greo) > > if [ -n $greo ]; then > $greo ... > fi > > command will search the directories defined in $PATH for the command > greo and return the fully qualified path. If it isn't found it will > return null. So, if $greo is non-zero

test for "command not found" before expanding shell parameters

2014-04-20 Thread Toralf Förster
Under Gentoo Linux I'd like to grep for various things in the package database in the following way: $> greo semanti /var/db/pkg/*/*/USE This might take a longer time for a low device before I'm faced with the message: "bash: greo: command not found" /me wonders if it is mandatory first to ex

Fwd: Re: [uml-user] wondering about the output of time command (real/user)

2008-08-04 Thread Toralf Förster
mand (real/user) Date: Monday 04 August 2008 19:00:35 : From: Jeff Dike <[EMAIL PROTECTED]> To: Toralf Förster <[EMAIL PROTECTED]> On Thu, Jul 24, 2008 at 06:11:48PM +0200, Toralf Förster wrote: > Hhm, > > running the same command both at the host : > > n22 ~ # time fact

set -x output of test operator is irretating

2008-07-27 Thread Toralf Förster
peat-By: [EMAIL PROTECTED] ~ $ echo "1 2 3 4" | while read a b c d; do [[ "$a" = "$b" || "$a" = "$c" || "$a" = "$d" ]] && echo oops; done + read a b c d + echo '1 2 3 4' + [[ 1 = \2 ]]

hist file seems to be deleted

2007-08-13 Thread Toralf Förster
4 .bash_history B/c I observed this in the last years only some times I'm not sure whether it is a general bug or if it happens only under some rare conditions. -- MfG/Sincerely Toralf Förster signature.asc Description: This is a digitally