On top of what Don Cragun already said, your script runs several commands per error list line, which might be considered not too efficient, esp. when dealing with long files. How about condensing the entire script down to a one liner with one grep and one sed only, making use of "process substitution" available in ksh et al.? Like
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
Hi All,
I have a file from Mainframe which has one of the lines with so many words... i tried to fold, format to 80 chararcter.. stil did not work. So i have decided to search for a string in that line Ex.FLIGHT PLAN and once if it is found i want to delete the entire line.
Please help... (2 Replies)
Hi
I want to read a file line by line and search for a particular string in each line(say for example string containing @ )and save that string into a variable.
Can someone suggest me the way to implement it.I am using K- shell
Thanks
Ishita (5 Replies)
let me start out by saying i have ZERO exp with any kind of scripting, so sorry if this is really basic stuff.....
For example, I need to have a script that will search a file and find this line in the file:
*.cat;dog;kennel;house;barn;horse;hay;coat hat
and remove the "coat" from the... (12 Replies)
Hi , I am breaking my head from past one day ...to delete lines from a file which match to the string pattern.:wall:
I am storing the search string in a variable and search if the file exists in the folder,if not delete that entry from the file.
I am having problem to delete that line from... (2 Replies)
All,
I am trying to read in a variable and search a file then delete based on that string, but i want to match exact word.
This works but it matches all, i don't want to match anthing that contains the string, just the exact string.
sed -i "/$feedname/d" file
I tried
sed... (1 Reply)
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Hi Everyone,
I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file.
I am very new to unix. Kindly help... (10 Replies)