I want to write a simple script which will have a list of numbers. And I want to take the first number on the list, put it into a variable, use this variable to use sed to print out a line in another document. Allow me to show you an example.
This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
variable= head -1 File1
sed -n '$variable p'
(How to remove the first line from File1, and redirect the output into the same file, overwriting it. Repeat process until the file has pointed to each line on the document.
Is this... not as simple as i'm thinking? Missing out some important concepts I should be learning?
Any help is greatly appreciated.
Last edited by MaestroRage; 02-12-2008 at 05:17 PM..
Shell script logic
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
wc -l file2.txt
head -5 file1.txt
101214100500... (10 Replies)
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)