User Tools

Site Tools


bash:append_a_string_after_each_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
bash:append_a_string_after_each_line [2019/12/07 01:32] – created peterbash:append_a_string_after_each_line [2021/01/09 13:38] (current) – removed peter
Line 1: Line 1:
-====== BASH - Append a string after each line ====== 
- 
-If your sed allows in place editing via the **-i** parameter: 
- 
-<code bash> 
-sed -e 's/$/string after each line/' -i filename 
-</code> 
- 
-If not, you have to make a temporary file: 
- 
-<code bash> 
-typeset TMP_FILE=$( mktemp ) 
- 
-touch "${TMP_FILE}" 
-cp -p filename "${TMP_FILE}" 
-sed -e 's/$/string after each line/' "${TMP_FILE}" > filename 
-</code> 
  
bash/append_a_string_after_each_line.1575682349.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki