10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have file contents
/tmp/x/abc.txt
/home/bin/backup/sys/a.log
I need this output:
/tmp/x/
/home/bin/backup/sys/
Can somebody please help me out
Please use CODE tags as required by forum rules! (3 Replies)
Discussion started by: jhonnyrip
3 Replies
2. Shell Programming and Scripting
Assume a string that contains one or multiple occurrences of three different keywords (abbreviated as "kw"). I would like to replace kw2 with some other string, say "qux". Specifically, I would like to replace that occurrence of kw2 that is the first one that is preceded by kw1 somewhere in the... (4 Replies)
Discussion started by: M Gruenstaeudl
4 Replies
3. UNIX Desktop Questions & Answers
hey , i m trying to figure out how to do the following :
i got a text file the looks like so:
1031
1031
1031
1031
1031
1031
1031
1031
16500
16500
16500
16500
1031
1031 (4 Replies)
Discussion started by: boaz733
4 Replies
4. Shell Programming and Scripting
I have a scenario, where i need to grep for the information and then exit.
i have to grep for "import done" and "bye" from success.log and then update a file with success if these words are present and failure if they are not present.
can any one help with this scenario? (4 Replies)
Discussion started by: chinuku
4 Replies
5. UNIX for Dummies Questions & Answers
I have 1300 files (SearchFiles0001.txt, SearchFiles0002.txt, etc.) , each with 650,000 lines, tab-delimited data.
I have a pattern file, with about 1000 lines with a single word. Each single word is found in the 1300 files once.
If I grep -f PatternFile.txt SearchFiles*.txt >OutputFile.txt... (2 Replies)
Discussion started by: newhavendweeb
2 Replies
6. Shell Programming and Scripting
I am trying to get the exit status of grep and test a condition with it, But it does not seem to be working as expected since i am doing something wrong apparently
as per grep help
Exit status is 0 if match, 1 if no match,
and 2 if trouble.
My problem is something like this
templine - a... (7 Replies)
Discussion started by: prasbala
7 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
is there a way to extract the line number of an occurrence using grep?
I know that with the -n option it prints out the line number as well.
I would like to assign the line number to a variable.
Thanks,
Sarah (5 Replies)
Discussion started by: f_o_555
5 Replies
8. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
9. Programming
Is it ok to use exit() inside a signal handler?
I catch SIGUSR1 in a signal handler and I try to close a file and then exit. The result is inconsistent. Sometimes the process exit and sometimes it returns to the original state before the signal handler was invoked.
Perhaps exit is not legal in... (8 Replies)
Discussion started by: Tuvia
8 Replies
10. Shell Programming and Scripting
Hi, I have a file that looks like this
dasdjasdjoasjdoasjdoa SYN dakspodkapsdka
asdasdasdasdasdasdasd SYN sdfsdfsdfsdfdf
shfishifhsdifhsidhfif fsdfsdfsdfsdfs
sdfsdfsdfsdsdfsdfsdff cercercercerce
sdasdajsdoajsodasodoo FIN dasdaskdpasdda... (4 Replies)
Discussion started by: hcclnoodles
4 Replies