10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
$ cat f1
My name is Bruce and my surname is
I want to use SED to find “Bruce” and then append “ Lee” to the end of the line in which “Bruce” is found
Then a more tricky one…. I want to INSERT ….a string… in to a line in which I find sometihng. So example
$ cat f2
My name is... (9 Replies)
Discussion started by: Imre
9 Replies
2. Shell Programming and Scripting
I have a file: file.txt, which contains the following data in it.
This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt
My name is not Karl, my name is Karl Joey
What is your name?
Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies
3. Shell Programming and Scripting
Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing.
the code is wrong. how to make it work. thanks a lot.
cat keywords.txt | while read line; do
awk -F"|" '{if (/$line/) {print $0"$line , ";} else print;}' outfile.txt > tmp
... (9 Replies)
Discussion started by: dtdt
9 Replies
4. Shell Programming and Scripting
A simple question, but i am finding it diffcult to find the answer.
Can you please tell me how i can get the output of two line on one.
I am aware i need to enter \ something, but no sure which charcter, can you advice.
CODE
for i in `cat LDN_HOSTS_190813 | grep -i LDN | awk '{print... (7 Replies)
Discussion started by: Junes
7 Replies
5. Shell Programming and Scripting
Hi all,
I'm trying to do a basic append into /home/joe/.bashrc:
/usr/bin/test -z `sudo /bin/grep umask /home/joe/.bashrc` && sudo /bin/sed -i '/PATH=/a \
umask 0022
' /home/joe/.bashrc
I run this as user floren with full root privileges in sudoers.
For some reason, the first command is... (1 Reply)
Discussion started by: TECK
1 Replies
6. Shell Programming and Scripting
Hi,
I have a File, which have multiple rows.
Like below
123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY
123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies
7. Programming
Hi,
I have a script which append the .csv file which already exist but in my scenarion every time instead of appending the contect it overwrite the file and creating new .csv file.
SET ORAUSR=ops$371664
SET ORAPWD=Oracle12345
SET ORADB=orcl
SET DBCON=%ORAUSR%/%ORAPWD%@%ORADB%
sqlplus... (1 Reply)
Discussion started by: tushar_spatil
1 Replies
8. Shell Programming and Scripting
After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh.
Now I've gotten the sed... (2 Replies)
Discussion started by: peachclift
2 Replies
9. Shell Programming and Scripting
Find in first column and replace the line with Awk, and output new file
File1.txt"2011-11-02","Georgia","Atlanta","x","",""
"2011-11-03","California","Los Angeles","x","",""
"2011-11-04","Georgia","Atlanta","x","x","x"
"2011-11-05","Georgia","Atlanta","x","x","" ... (4 Replies)
Discussion started by: charles33
4 Replies
10. Shell Programming and Scripting
Hi,
I have a command "get_data" with some parameters in few *.text files of a directory. I want to first find those files that contain this command and then append the following parameter to the end of the command.
example of an entry in the file :-
get_data -x -m50 /etc/web/getid
this... (1 Reply)
Discussion started by: PrasannaKS
1 Replies