10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
i had the below script
x=`cat input.txt |wc -1`
awk 'NR>1 && NR<'$x' ' input.txt > output.txt
by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
2. Shell Programming and Scripting
I am attempting to rename files within a zipped archive with the beginning of the name of the zip file. For example unzip AAA_000.zip and rename file1.csv, file2.txt to AAA_file1.csv, AAA_file2.txt.
I am able to do this for a zip file with one file inside, but not for multiple files. This is... (2 Replies)
Discussion started by: lcp
2 Replies
3. UNIX for Dummies Questions & Answers
Hi ladies and gentleman.. I have two text file with me. I need to replace one of the file content to another file if one both files have a matching pattern.
Example:
text1.txt:
ABCD 1234567,HELLO_WORLDA,HELLO_WORLDB
DCBA 3456789,HELLO_WORLDE,HELLO_WORLDF
text2.txt:
XXXX,ABCD... (25 Replies)
Discussion started by: bananamen
25 Replies
4. Shell Programming and Scripting
Plese help I need a urgent requirement.
Ex: test.log
requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb
and then in the archive folder log files are name to test.tar
test1.tar
test2.tar
EX:
/home/abc/
test.log ... (1 Reply)
Discussion started by: johney1981
1 Replies
5. Shell Programming and Scripting
I need to be able to take the results from ls -l command and modify the output as follows:
I will run
ls -l *.mak
My results will be
aa.mak
bb.mak
cc.mak
I then need to take those results and create a file that has the following info:
dsjj/ubin/aa
dsjj/ubin/bb
dsjj/ubin/cc
... (3 Replies)
Discussion started by: jclanc8
3 Replies
6. Shell Programming and Scripting
hi people,
i have texts down.txt and down-new.txt and i want to check;
- if down-new.txt is NOT empty, then write date and its content to /home/gc_sw/down.txt
for example;
down.txt:AAAA
SSSS
down-new.txt:123
456
and after checking down-new.txt is NOT empty, down.txt should... (10 Replies)
Discussion started by: gc_sw
10 Replies
7. UNIX for Dummies Questions & Answers
I've setup a cron job that greps a file every five minutes and then writes (appends) the grep output/result to another file:
grep "monkey" zoo.log | tail -1 >> cron-zoo-log
Is there any way I can add the date and time (timestamp) to the cron-zoo-log file for each time a new line was added?
... (12 Replies)
Discussion started by: Sepia
12 Replies
8. Shell Programming and Scripting
Hey guy,
how to make bash script to create foo.txt file and add current date into file content and that file always append.
example: today the script run and add today date into content foo.txt
and tomorrow the script will run and add tomorrow date in content foo.txt without remove today... (3 Replies)
Discussion started by: chenboly
3 Replies
9. UNIX for Dummies Questions & Answers
i need a script which will create a archive of the files older than 10 days........ (2 Replies)
Discussion started by: jayaramanit
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
After checking all the UNIX threads, I am able to come up with a solution so far. I am working on a shell script where it moves the files to a certain directory. The conditions to check are
1) Check if the file exists in the current directory.
2) Check if the destination directory... (2 Replies)
Discussion started by: madhunk
2 Replies