10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am running a while loop in a script ro read a file line by line.
Now I want to run a grep only on the lines below the line I am that is being read by the while loop.
If my while loop is on line 4 of the file, the grep only runs below line 4 and does not include line 1,2... (3 Replies)
Discussion started by: Junaid Subhani
2. Shell Programming and Scripting
my requirement is,
consider a file output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
this doesnt look good
et cetc etc
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Discussion started by: vivek d r
3. Shell Programming and Scripting
I've a file like this..
a,13 (7 Replies)
Discussion started by: manab86
4. Shell Programming and Scripting
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
while read -r line; do #I'm reading from a big wordlist
instructions using $line
Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
5. Shell Programming and Scripting
I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting?
<head>... (6 Replies)
Discussion started by: vel4ever
Could you please tell me how to get a specific line number from a text file?
For example below,
DEF ---> Get this line number, return to an variable
My OS is Linux.
Thank you so much for your help in advance! (3 Replies)
Discussion started by: barryxian
7. Shell Programming and Scripting
Hi guys ,
I m writing a script to delete a line at particular location.
But i m unable to use variable for specifying line number.
sed -n '7!p' filename
works fine and deletes 7th line from my file
sed -n '$variable!p' filename
gives following error.
sed: -e... (12 Replies)
Discussion started by: pinga123
8. Shell Programming and Scripting
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
9. Shell Programming and Scripting
I want to extract certain text between two line numbers like
How do I do this with a simple sed or awk command?
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
10. Shell Programming and Scripting
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy