3 ms·
A one-liner script for shell output redirection that inserts instead of appends Typically cat file2 >> file1 If want to place file2 at the top of file1 i
by 1vuio0pswjnm7 1y ago
A one-liner script for shell output redirection that inserts instead of appends
Typically
cat file2 >> file1
If want to place file2 at the top of file1 instead of the bottom
cat file2 file1 > file3
mv file3 file1
Too much typing, margin for error
The script is called "ins"
ins file1 < file2
Can also use line number
ins file1 25 < file2
Inserts file2 at line 25 of file1
One of the most useful scripts I have ever written
Only uses sed or ed