Search Results

Search: Posts Made By: psve
1,201
Posted By psve
Through 'ed' works slow. I think I like this the...
Through 'ed' works slow. I think I like this the best:
find . -type f -name "*.c" -exec sh -c 'cat Head.txt "$1" > test.txt && mv test.txt "$1"' sh {} \;
19,469
Posted By psve
What is the 'H' command doing? Why is it required?
What is the 'H' command doing? Why is it required?
1,201
Posted By psve
Insert file.txt recursively
Anyone knows how I can change this script so that it works recursively as well (meaning: *.c files in sub directories will get changed as well)?
for file in *.c
do
cat file.txt "$file" >...
19,469
Posted By psve
Excellent! Thanks guys. I appreciate all your...
Excellent! Thanks guys. I appreciate all your help.
19,469
Posted By psve
Thanks guys. One more difficulty. I run the...
Thanks guys. One more difficulty. I run the following script from cygwin:

#!/bin/bash
for file in *.c
do
cat Head.c "$file" > tempfile && mv tempfile "$file"
done

...and get the following...
19,469
Posted By psve
insert file.txt to muliple files
Actually, I wanted to find a batch script that applies this insert 'file.txt' to all .c files in the current directory. So, in that case awk might be the best solution I guess:

find . -name "*.c"...
19,469
Posted By psve
Using sed to insert text file at first line
sed '1r file.txt' <source.txt >desti.txt

This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.

Does anyone...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 05:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy