Portál AbcLinuxu, 28. července 2025 12:09
dan@holly:~$ declare -i WEEK; WEEK=$(date +%V) bash: 08: value too great for base (error token is "08")sice jsem k tomu vygooglil jakesi reseni, ale ani tam pouzity priklad mi nefunguje
dan@holly:~$ cat $(([10#08]+2)) bash: [10#08]+2: syntax error: operand expected (error token is "[10#08]+2")Jelikoz nerozumim podstate, jak odstranit nulu, nedari se mi pohnout z mista.
cat $(($[10#08]+2))
Zkus toto:
declare -i WEEK; WEEK=$[10#$(date +%V)]; echo $WEEK
The old format $[expression] is deprecated and will be removed in upcoming versions of bash.To je sice pravda, ale je to kratší (a jestli se to bude rušit tak dlouho, jako
ifconfig
...)
WEEK=10#$(date +%V);
# declare -i WEEK; WEEK=10#$(date +%V);
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.