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
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)-
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
On 4/13/19 3:54 AM, konsolebox wrote:
>
> shift "$(( n < $# ? n : $# ))"
Yep - thx!
--
Toralf
PGP C4EACDDE 0076E94E
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
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
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
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
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
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 ]]
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
11 matches
Mail list logo