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
Hi,
I have been trying to do a small fun project for myself.
I want to run a command for 45 seconds.
And to get the final output of this command, the script requires I push the "q" key on my keyboard and then the final output file becomes available.
I tried the following script. But it... (12 Replies)
Discussion started by: jacobs.smith
12 Replies
3. Shell Programming and Scripting
Hi,
I want to add a text to the end of the specific line in a file. Now my file looks like this:
999
111
222
333
111
444
I want to add the string " 555" to the end of the first line contaning 111. Moreover, I want to insert a newline after this line containg the "000" string. The... (8 Replies)
Discussion started by: wenclu
8 Replies
4. Shell Programming and Scripting
I am using
echo "HELLO"
I want to specify a number shiftWt so that I move hello forward by shiftWt charcaters.
Is there a way to do this? (2 Replies)
Discussion started by: kristinu
2 Replies
5. UNIX for Dummies Questions & Answers
I have a file similar to the following
filler filler filler
car 6 mazda
filler filler filler filler
car civic honda
car rav 4 toyota
filler filler
If i do a "grep -i car file.txt" the output would be
car 6 mazda
car civic honda
car rav 4 toyota
however, i want to have the... (4 Replies)
Discussion started by: jl487
4 Replies
6. 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
7. Shell Programming and Scripting
Hi,
Is there a command to print one character x amont of times?
I need for example 10 comma's (,,,,,,,,,,). Instead of creating a loop, I was wondering if there is a way to do this with sed or awk?
Thanks! (3 Replies)
Discussion started by: Subbeh
3 Replies
8. 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
9. UNIX for Dummies Questions & Answers
Hi,
Is there any way of using grep (this may be done in awk, not sure?) that I can stop grep'n a file once I have found the first occurrence of my search string. Looking through grep man pages
-q will exit without printing the lines after the first match, but I need the output.
I have... (5 Replies)
Discussion started by: nhatch
5 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