Difference between revisions of "Scripting"
From Linuxintro
imported>ThorstenStaerk |
imported>ThorstenStaerk (export-import does not work with "\n") |
||
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
} | } | ||
defines a function in [[bash]]. | defines a function in [[bash]]. | ||
+ | |||
+ | = Usecases = | ||
+ | Delete linebreaks | ||
+ | [[cat]] ''file'' | tr '\n' '; ' > ''newfile'' | ||
= TroubleShooting = | = TroubleShooting = | ||
− | |||
− | |||
If you want every line to be shown with evaluated values, write the following to the beginning of the script: | If you want every line to be shown with evaluated values, write the following to the beginning of the script: | ||
set -x | set -x | ||
or -xv for verbose | or -xv for verbose | ||
+ | |||
+ | = See also = | ||
+ | * [[shell programming]] |