Skip to main content
reworked to read better, removal of google search as it won't show the results now as it did then, formatting, etc. while still keeping the original intention imo
Source Link

This doesn't use sedWithout sed, but using >> willyou can use >> to append to a file. ForFor example:

echo 'one, two, three' >> testfile.csv

Edit: To prepend to a file, try something like this:

echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile

I found this through a quick Google search.

This doesn't use sed, but using >> will append to a file. For example:

echo 'one, two, three' >> testfile.csv

Edit: To prepend to a file, try something like this:

echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile

I found this through a quick Google search.

Without sed, you can use >> to append to a file. For example:

echo 'one, two, three' >> testfile.csv

To prepend to a file, try something like:

echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile
Answered his new question
Source Link
Scottie T
  • 12.3k
  • 11
  • 50
  • 59

This doesn't use sed, but using >> will append to a file. For example:

echo 'one, two, three' >> testfile.csv

Edit: To prepend to a file, try something like this:

echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile

I found this through a quick Google search.

This doesn't use sed, but using >> will append to a file. For example:

echo 'one, two, three' >> testfile.csv

This doesn't use sed, but using >> will append to a file. For example:

echo 'one, two, three' >> testfile.csv

Edit: To prepend to a file, try something like this:

echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile

I found this through a quick Google search.

Source Link
Scottie T
  • 12.3k
  • 11
  • 50
  • 59

This doesn't use sed, but using >> will append to a file. For example:

echo 'one, two, three' >> testfile.csv