New answers tagged text-formatting
1
vote
Inserting text with formatting at the start of a file with printf
What I would do, using sponge from moreutils:
{
printf 'Anything\tyou\twant\tto\tadd'
cat file
} | sponge file
or in a one-liner:
{ printf 'Anything\tyou\twant\tto\tadd'; cat file; } | sponge
...
Top 50 recent answers are included
Related Tags
text-formatting × 615text-processing × 179
awk × 178
sed × 124
shell-script × 60
bash × 56
linux × 53
command-line × 49
csv × 30
columns × 30
grep × 28
scripting × 23
text × 23
printf × 22
shell × 20
files × 16
regular-expression × 16
string × 13
perl × 11
sort × 10
json × 10
cut × 10
colors × 9
output × 9
date × 8