Results 1 - 18 of about 18 results out of about 57349 pages. (0.03 seconds)
- BashSyntaxReference . . . 12 matches
- ... the current user's home directory.||
||`~`||`mode=$((mode & ~umask))`||In an [[ArithmeticExpression]], bitwise NOT.||
||`~`''user''||`cd ~john`||Expands to the home directory of '...
- BashPitfalls . . . 3 matches
- ..., the [[BashFAQ/031|[[ command]] should ''not'' be used solely for evaluating [[ArithmeticExpression|arithmetic expressions]]. It should be used for test expressions involving one ...
- BashFAQ/005 . . . 3 matches
- ...
done <file
[[ $REPLY ]] && lines[i]=$REPLY
}}}
The square brackets create a [[ArithmeticExpression|math context]]. The result of the expression is the index used for assignment.
...
- BashWeaknesses . . . 2 matches
- ...sh may not be the best choice.
1. '''Floating point math'''. Bash has only [[ArithmeticExpression|integer math]]. Use `bc(1)` or `awk(1)` if you need to do floating point math....
- BashGuide/SpecialCharacters . . . 2 matches
- ...t on the current shell. ||
|| `(( ))` || ''Arithmetic expression'' — with an [[ArithmeticExpression|arithmetic expression]], characters such as `+`, `-`, `*`, and `/` are mathemat...
- BashFAQ/121 . . . 2 matches
- ...eat for base (error token is "09")
}}}
When a zero-padded value is used in a [[ArithmeticExpression|math context]], the value is treated as octal (base 8). In the ''best'' cases,...
- BashFAQ/031 . . . 2 matches
- ... {{{[[}}} is used for strings and files. If you want to compare numbers, use an ArithmeticExpression, e.g.
{{{
# Bash
i=0
while (( i < 10 )); do ...
}}}
When should the new test c...
- ProcessManagement . . . 1 match
- ...
See [[BashFAQ/001|reading a file line-by-line]] and [[BashFAQ/005|arrays]] and ArithmeticExpression for explanations of the syntax used in this example.
Even if the lists aren't ...
- CategoryShell . . . 1 match
- ...##master-page:CategoryTemplate
##master-date:Unknown-Date
#format wiki
#language en
These pages discuss issues associated with the Unix command line shells, especially bash, but a...
- BashSheet . . . 1 match
- ...keyword is specialized in performing numeric tests and operations'''. <<BR>>See ArithmeticExpression
= Parameters =
Parameters are what Bash uses to store your script data in. Th...
- BashFAQ/105 . . . 1 match
- ...'s more! ===
Even if you use `expr(1)` (which we ''do not'' recommend -- use [[ArithmeticExpression|arithmetic expressions]] instead), you still run into the same problem:
{{{#!h...
- BashFAQ/073 . . . 1 match
- ...ince octal 777 + 1 is octal 1000) which is probably not what was intended. See ArithmeticExpression.
Quoting is not needed in variable assignment, since WordSplitting does not o...
- BashFAQ/067 . . . 1 match
- ...eading zeroes from a number in bash is to treat it as a decimal integer, in a [[ArithmeticExpression|math context]]:
{{{
# Bash
x=$((10#$x))
# However, this fails if x co...
- BashFAQ/022 . . . 1 match
- ...e with floating point numbers instead of just integers? ==
[[BASH]]'s builtin [[ArithmeticExpression|arithmetic]] uses integers only:
{{{
$ printf '%s\n' "$((10 / 3))"
3
}}}
For m...
- BashFAQ/019 . . . 1 match
- ...hunk + 1))
cur=$((cur + range))
done
}}}
The previous example uses POSIX [[ArithmeticExpression|arithmetic]], which older [[BourneShell|Bourne shells]] do not have. In that ca...
- BashFAQ/017 . . . 1 match
- ... more powerful comparison commands with slightly different (easier) quoting:
* ArithmeticExpression for arithmetic expressions, and
* NewTestCommand for string (and file) express...
- BashFAQ/004 . . . 1 match
- ...( ${#files[*]} )) || echo directory is empty
shopt -u nullglob dotglob
}}}
See ArithmeticExpression for explanations of arithmetic commands.
Of course, you can use any glob you l...