scripting:sh
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scripting:sh [2012-02-08 11:57] – created root | scripting:sh [2016-05-20 17:00] (current) – root | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Bourne Shell ====== | ====== Bourne Shell ====== | ||
- | == Text zeilenweise verarbeiten | + | == Loop through multi line text (including spaces) |
- | < | + | < |
- | while read LINE; | + | while read LINE |
do | do | ||
- | | + | |
done <<< | done <<< | ||
</ | </ | ||
+ | or in bashish with command output: | ||
+ | |||
+ | <code bash> | ||
+ | while read LINE | ||
+ | do | ||
+ | echo " | ||
+ | done <<< | ||
+ | </ | ||
+ | |||
+ | == Calculations == | ||
+ | |||
+ | awk | ||
+ | <code bash> | ||
+ | echo 3.14158 2.348 | awk '{ printf(" | ||
+ | echo "" | ||
+ | awk '{ print $1/2 }' <<< | ||
+ | </ | ||
+ | |||
+ | bc | ||
+ | <code bash> | ||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | bash | ||
+ | <code bash> | ||
+ | result=$((30*1000/ | ||
+ | </ |
scripting/sh.1328698653.txt.gz · Last modified: 2014-12-18 20:10 (external edit)