10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have some data that looks like this:
PXD= ZW< 1,6
QR> QRJ== 1,2(5)
QR> QRJ== 4,1(2)
QR> QRJ== 4,2
QRB= QRB 4,2
QWM QWM 6,2
R<C ZW< 11,2
R<H= R<J= 6,1
R>H XZJ= 1,2(2)
R>H XZJ= 2,6(2)
R>H XZJ= 4,1(2)
R>H XZJ= 6,2
RDP RDP 1,2
What I would like to do is if fields $1 and $2 are... (5 Replies)
Discussion started by: jvoot
5 Replies
2. UNIX for Beginners Questions & Answers
Hi,
I have a file as follows.
file1
Hello
Hi
His
Hi
Hi
Hungry
hi
so I want to delete identical lines while leaving one of them undeleted.
So desired output will be
Hello
Hi (2 Replies)
Discussion started by: beginner_99
2 Replies
3. Shell Programming and Scripting
I have the following file
299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:1.45
299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:0.283
311027 chrX_310892_311162 300 91.6452... (2 Replies)
Discussion started by: jfern
2 Replies
4. Shell Programming and Scripting
I am trying to extract a table of data (mysql query output) from a log file. I need to print everything below the header and not past the end of the table. I have spent many hours searching with little progress. I am matching the regexp +-\{99\} with no problem. I just can't figure out how to print... (5 Replies)
Discussion started by: godfreydanials
5 Replies
5. Shell Programming and Scripting
Mysql log has something like below:
I need a bash shell script that will do the following:
1) The script will scan the mysql.log file constantly in real time (something like tail -F mysql.log)
2) If it encounters 5 consecutive identical lines then it would invoke some commands (say... (4 Replies)
Discussion started by: proactiveaditya
4 Replies
6. UNIX for Dummies Questions & Answers
I have a file that looks like this 10 user1s, 5 user2s and 10 users3.
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.1 user1
10.10.1.2 user2
10.10.1.2 user2
10.10.1.2 user2... (7 Replies)
Discussion started by: lawsongeek
7 Replies
7. Shell Programming and Scripting
Hi all,
I'm looking for a way to generate an error when a command does not print an expected message. For example :
test.sh :
echo hi!test.exp :
exp_internal 1
spawn ./test.sh
expect {
"hi!" {puts "bingo!"}
"*" {puts "error!" ; exit 1}
}
I expected test.exp to match the string... (2 Replies)
Discussion started by: whbos
2 Replies
8. Shell Programming and Scripting
I am looking to replace two or more strings on different lines using sed, but not with the same variable. IE
# cat xxx.file
<abc>
abc def ghi
abc def ghi
abc def ghi
currently I can only change each line with the same pattern:
# sed -e '/<abc>/!s/abc\(.*\)/jkl mno/' xxx.file
abc jkl mno... (3 Replies)
Discussion started by: prkfriryce
3 Replies
9. Shell Programming and Scripting
From the below file I want to grep only the lines except the comment sections. But grep -v "#" is eliminating the last line because it has one # in between.
Any idea how can I ignore only the lines which have # at the begining (I mean comment lines) ?
Thanks a lot to all in advance
C Saha (1 Reply)
Discussion started by: csaha
1 Replies
10. Shell Programming and Scripting
Is there a standard way to make a shell script read a file, or list, and skip each line that contains # at the begining, or ignores the content starting after a # in line?
I'm looking to mimic the way commenting in a shell script normally works. This way I can comment my text files and lists my... (4 Replies)
Discussion started by: sysera
4 Replies