10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm looking to write a script that takes a .txt filename as an argument, reads the file line by line, and passes each line to a command. For example, it runs command --option "LINE 1", then command --option "LINE 2", etc. I am fetching object files from a library file, I have all the object file... (2 Replies)
Discussion started by: Paul Martins
2 Replies
2. Shell Programming and Scripting
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
3. Shell Programming and Scripting
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Discussion started by: vivek d r
3 Replies
4. Shell Programming and Scripting
Say I have a text file, with several lines. Each line may contain spaces or the # symbol.
For each line, I want to pass that line as the path of a file, in order to add it to a tar file.
I've tried this but doesn't work:
cat contents.txt | xargs -0 `tar -uvf contents.tar $1`Any ideas?
... (3 Replies)
Discussion started by: Tribe
3 Replies
5. UNIX for Advanced & Expert Users
I have two files
a.txt
b.txt
I want to find a line in a.txt and replace by another line from b.txt
a.txt
asfsdfsfsfdfsf
asfwererfgdgf
wrerwetretfdg
b.txt
werdfgdfgf
werergfdgd
sfdfgfgfgfgg
i want to replace the 1st line of a.txt by 1st line of b.txt
i want out put as (5 Replies)
Discussion started by: rammm
5 Replies
6. Shell Programming and Scripting
Further to my earlier question regarding embedded commands I now want to delete then replace the last line in a file in memory....
FILEHERE=$((echo "$FILEHERE" | sed -e '$d' ) echo "this now added")
this is throwing a syntax error but as I'm still getting used to this structure I... (1 Reply)
Discussion started by: Bashingaway
1 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a file and in that, I want to search for a aprticular word and then replace another word in the same line with something else.
Example: In file abc.txt, there is a line
<host oa_var="s_hostname">test</host>
I want to search with s_hostname text and then replace test with... (2 Replies)
Discussion started by: sshah1001
2 Replies
8. Shell Programming and Scripting
Hi,
I am a newbie to shell scripting and to Linux environment as well.
In my project I am trying to search for following text from the httpd.conf file
<Directory '/somedir/someinnerdir'>
AllowOverride All
</Directory>
and then remove this text and again rewrite the same text.
The... (1 Reply)
Discussion started by: bhushan
1 Replies
9. UNIX for Dummies Questions & Answers
i am very new to UNIX
plz help me in this scenario
i have two text files as below
file1.txt
name=Rajakumar.
Discipline=Electronics and communication.
Designation=software Engineer.
file2.txt
name=Kannan.
Discipline=Mechanical.
Designation=CADD Design Engineer.
... (6 Replies)
Discussion started by: kkraja
6 Replies
10. UNIX for Dummies Questions & Answers
I need to change the first line a file from
"HDR,{any_number}",,,,,
where {any_number} is incremental for each file
to
HDR,{any_number}
Can someone please suggest an easy way please
Regards
Col (3 Replies)
Discussion started by: colinchase
3 Replies