docs:tips_n_tricks:shellscripting:shellscripting.html
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
docs:tips_n_tricks:shellscripting:shellscripting.html [08.04.2024 00:19 CEST] – [Colour diff output word-by-word] peter | docs:tips_n_tricks:shellscripting:shellscripting.html [08.04.2024 00:24 CEST] (current) – [Read output of command without pipe] peter | ||
---|---|---|---|
Line 322: | Line 322: | ||
done | done | ||
</ | </ | ||
+ | |||
+ | ===== Running pipes in bash shellscripts in same shell environment | ||
+ | This works only for one pipe or the last command piped to in a sequence | ||
+ | |||
+ | <code bash read_ls_lines.sh [highlight_lines_extra=" | ||
+ | #!/bin/bash | ||
+ | |||
+ | shopt -s lastpipe | ||
+ | |||
+ | datas=() | ||
+ | # touch "Mal was mit Lücken" | ||
+ | ls -a1 | while read data | ||
+ | do | ||
+ | datas=(" | ||
+ | done | ||
+ | |||
+ | i=1 | ||
+ | for line in " | ||
+ | do | ||
+ | printf "%d: %s\n" " | ||
+ | done | ||
+ | </ | ||
+ | |||
docs/tips_n_tricks/shellscripting/shellscripting.html.txt · Last modified: 08.04.2024 00:24 CEST by peter