Results 1 - 25 of about 28 results out of about 112407 pages. (0.06 seconds)

BashFAQ/005 . . . 11 matches
...itionally have [[BashGuide/Arrays#Associative_Arrays|Associative Arrays]] (see also [[BashFAQ/006|FAQ 6]]). This article focuses on indexed arrays as they are the most common type...

19.7k - rev: 77 (current) last modified: 2023-03-25 22:39:06

BashFAQ/006 . . . 15 matches
...able in POSIX shells.) 4. If the program handles unsanitized user input, it can be [[BashFAQ/048|VERY dangerous]]! Read [[BashGuide/Arrays]] or [[BashFAQ/005]] for a more in-dep...

16.8k - rev: 63 (current) last modified: 2023-04-14 06:52:11

BashFAQ/100 . . . 12 matches
...oduction to bash string manipulations and related techniques. It overlaps with the [[BashFAQ/073|Parameter Expansion]] question, but the information here is presented in a more b...

24.3k - rev: 47 (current) last modified: 2023-06-26 10:03:19

BashFAQ/001 . . . 11 matches
... [[#source|source selection]] below. If you want to read lines from a file into an [[BashFAQ/005|array]], see [[BashFAQ/005|FAQ 5]]. <<TableOfContents>> <<Anchor(trimming)>> ==...

9.8k - rev: 72 (current) last modified: 2023-06-28 01:53:29

BashFAQ/050 . . . 8 matches
...ant to pass options if the runtime data needs them === You can use the `${var:+..}` [[BashFAQ/073|parameter expansion]] for this: {{{ ping -q ${count:+"-c$count"} -- "$HOSTNAME" ...

11.6k - rev: 61 (current) last modified: 2024-04-15 23:48:57

BashFAQ/040 . . . 6 matches
...{{{eval}}} for that purpose, but the cleanest way to achieve this goal is to use an [[BashFAQ/005|array]]. {{{#!highlight bash # Bash unset -v m; i=0 words=(apple banana cherry "...

3.1k - rev: 14 (current) last modified: 2022-04-13 15:05:34

BashFAQ/004 . . . 6 matches
...ob` and `dotglob` options (which change the behaviour of [[glob|globbing]]), and an [[BashFAQ/005|array]]: {{{#!highlight bash # Bash shopt -s nullglob dotglob files=(*) (( ${#fi...

8.4k - rev: 50 (current) last modified: 2023-03-28 07:52:15

BashFAQ/044 . . . 5 matches
...cho $((100*(++i)/n)) done ) }}} Here's an explanation of what it's doing: * An [[BashFAQ/005|array]] named {{{files}}} is populated with all the files we want to process. * ...

5.3k - rev: 15 (current) last modified: 2017-11-13 22:19:11

BashFAQ/026 . . . 5 matches
...ay[rand]} array[rand]=$tmp done } }}} This function shuffles the elements of an [[BashFAQ/005|array]] in-place using the [[http://en.wikipedia.org/wiki/Knuth_shuffle|Knuth-Fis...

12.6k - rev: 48 (current) last modified: 2022-01-30 23:49:34

BashFAQ/025 . . . 5 matches
..."$@"`" }}} In addition, bash and ksh93 treat the set of positional parameters as an [[BashFAQ/005|array]], and you may use [[BashFAQ/073|parameter expansion]] syntax to address th...

2.0k - rev: 26 (current) last modified: 2024-03-28 14:56:51

BashFAQ/118 . . . 4 matches
...r, or reverse an array? == First note that the concept of ''order'' applies only to [[BashFAQ/005|indexed arrays]], not associative arrays. The answers would be simpler if there ...

4.3k - rev: 3 (current) last modified: 2019-04-17 19:00:47

BashFAQ/096 . . . 4 matches
..., bash provides a way to protect such things safely: `printf %q`. Together with an [[BashFAQ/005|array]] and a loop, we can write a wrapper: {{{ # Bash 2.05b and up # Your accou...

5.1k - rev: 10 (current) last modified: 2020-03-10 20:44:49

BashFAQ/073 . . . 4 matches
...ers#Parameter_Expansion|Bash Guide]] includes an introduction for beginners. * The [[BashFAQ/100|string manipulation tutorial]] is a more in-depth tutorial with additional exampl...

12.0k - rev: 53 (current) last modified: 2023-06-24 09:33:51

BashFAQ/095 . . . 3 matches
...he `-exec` only passes it one name.) The most general alternative is to use a Bash [[BashFAQ/005|array]] and a loop to process the array in chunks: . {{{ # Bash files=(/usr/inc...

3.2k - rev: 5 (current) last modified: 2018-07-06 17:47:06

BashFAQ/094 . . . 3 matches
...s is the workaround for lines being split unpredictably. For example, using a Bash [[BashFAQ/005|array]] df_arr: {{{ ~$ read -d '' -ra df_arr < <(LC_ALL=C df -P /); echo "${d...

9.4k - rev: 11 (current) last modified: 2016-03-31 10:02:39

BashPitfalls . . . 25 matches
...` loop body) is executed in the current shell. You can set variables and have them [[BashFAQ/024|persist after the loop ends]]. The other option, available in [[BashFAQ/061|Bash...

86.2k - rev: 572 (current) last modified: 2024-04-04 23:09:24

ProcessManagement . . . 10 matches
... file descriptors have been redirected so they aren't holding the terminal open, or [[BashFAQ/063|the ssh client may hang]]. == I'm trying to kill -9 my job but blah blah blah......

46.6k - rev: 88 (current) last modified: 2023-08-09 06:29:52

BashGuide/Parameters . . . 9 matches
...al/bashref.html#Shell-Variables|Shell Variables]] ---- . '''In the FAQ''': <<BR>> [[BashFAQ/013|How can I concatenate two variables? How do I append a string to a variable?]] <<...

19.0k - rev: 45 (current) last modified: 2017-04-07 00:32:44

Bashism . . . 8 matches
...h; present in zsh. || ||file slurp ||`$(< file)` ||`$(cat file)` ||Or read the file [[BashFAQ/001|line by line]]. || == Expansions == * Brace Expansion, eg `{a,b,c}` or `{1..10...

12.5k - rev: 93 (current) last modified: 2022-10-20 23:13:29

BashGuide/Arrays . . . 6 matches
...software/bash/manual/bashref.html#Arrays|Arrays]]''' ---- . '''In the FAQ: <<BR>> [[BashFAQ/005|How can I use array variables?]] <<BR>> [[BashFAQ/006|How can I use variable vari...

24.6k - rev: 45 (current) last modified: 2021-10-23 00:18:04

ArithmeticExpression . . . 6 matches
...h only. You can't do floating point math in Bash; if you need that capability, see [[BashFAQ/022|Bash FAQ #22]]. /!\ The `$[ ]` syntax is [[http://wiki.bash-hackers.org/syntax/e...

11.1k - rev: 37 (current) last modified: 2023-12-11 16:33:33

Arguments . . . 6 matches
... This ''zeroth'' argument is the name that we wish to give the process. It's only [[BashFAQ/028|vaguely defined]] what exactly that means and what it's used for, and it's irrele...

17.5k - rev: 29 (current) last modified: 2020-07-06 20:52:07

DontReadLinesWithFor . . . 5 matches
...file. This is clumsy and inefficient at best, and fails in many cases. You should [[BashFAQ/001|use a while loop]] instead. Here is why. First, the right way: {{{ $ cat afile...

3.3k - rev: 5 (current) last modified: 2016-12-07 22:21:19

WordSplitting . . . 4 matches
...}}} `"$@"` causes each positional parameter to be expanded to a separate word; its [[BashFAQ/005|array]] equivalent likewise causes each element of the array to be expanded to a ...

8.7k - rev: 14 (current) last modified: 2023-09-21 06:22:37

BashSheet . . . 3 matches
...Parameters#Parameter_Expansion|the BashGuide's section on Parameter Expansion]] and [[BashFAQ/073]]. * `"$var"`, `"${var}"` . '''Expand the value contained within the paramete...

54.2k - rev: 91 (current) last modified: 2021-12-20 04:19:50

1 2 Next