10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
2. Shell Programming and Scripting
Linux version : Oracle Linux 6.5
Shell : bash
In the the below text file (someString.text), I want to grep all lines with .sh in it. ie. Only the lines mysript.sh and anotherscript.sh should be returned.
My below attempts failed.
I gather that in regular expression world, dot (.) is the... (3 Replies)
Discussion started by: John K
3 Replies
3. UNIX for Dummies Questions & Answers
Hi all!
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Example:
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Discussion started by: demmel
8 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to fetch lines before a pattern, I got to know about -B flag in grep but we have to pass the number to get those lines before some pattern say (X), now what if I want to get line/s with some other pattern say (Y) before X pattern? How to get about it? please help.
Input:... (5 Replies)
Discussion started by: dips_ag
5 Replies
5. Shell Programming and Scripting
Hi Experts,
Need help with the following:
Desired output:
Only want to get the output marked in green.
The file:
--- Physical volumes ---
PV Name /dev/disk/disk4704
PV Status available
Total PE 6399
Free PE ... (3 Replies)
Discussion started by: rveri
3 Replies
6. Shell Programming and Scripting
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
Discussion started by: rbalaj16
5 Replies
7. Shell Programming and Scripting
Hi,
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Discussion started by: abinash
3 Replies
8. Shell Programming and Scripting
Hi All,
I need your help in finding pattern from files present in different directories.
I need to search for a pattern "xyz" from "*.txt" files which are present in different levels of directories as shown.
example
-------
dir1/subdir1/file.txt
dir2/subdir2/subsubdir2/file.txt... (5 Replies)
Discussion started by: imas
5 Replies
9. Shell Programming and Scripting
Hi experts
I want the proper argument to the grep command so that I need to skip the first few lines(say first 10 lines) and print all the remaining instances of the grep output.
I tried to use grep -m 10 "search text" file*. But this gives the first 10 instances(lines) of the search string.... (7 Replies)
Discussion started by: ks_reddy
7 Replies
10. UNIX for Dummies Questions & Answers
OK. I have a file I'd like to be able to grep, but on top of returning the line where the pattern matches, I'd like to be able to get the previous 8 lines and the following 8 lines. Is there a way to do this? (2 Replies)
Discussion started by: mrwatkin
2 Replies