plz help deliverable unix masters


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers plz help deliverable unix masters
# 1  
Old 11-06-2008
plz help deliverable unix masters

i have two requirement

a file1 has field CNT=1000
i want to take count on file2 which can be like 2000
and replace in file1 so it becomes CNT=2000

a file1 has field TSTMP=2008-11-06-15.54.20.000000
i want to take the file creation date on file2 which can be like 2009-11-06-15.54.20.000000
and replace in file1 so it becomes TSTMP=2009-11-06-15.54.20.000000
# 2  
Old 11-07-2008
Code:
read replacestring <file2
sed -i 's/^CNT=[0-9]*$/CNT='$replacestring'/' file1

Be careful that replacestring (in file2) does not have any special characters in it, like backslashes.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

am a newbie to unix. plz help in understanding this code.

hi everybody. please help me in understanding this code. echo "************* starting job on `date +\"%d/%m/%Y at %T\"` **************" # scriptdir=`dirname $0` . ${scriptdir}/env_params.sh # SHLIB_PATH=${ORACLE_HOME}/lib: export SHLIB_PATH export... (1 Reply)
Discussion started by: gokulj
1 Replies

2. Shell Programming and Scripting

Very New To Unix Shell Programming:Plz Help

Hi Gurus I am very new to Unix Shell Prog. I have a file in format Q1 Dirname-FileName Score Remarks i.e. containing columns separated by space. I want to read Column 1 and 2 and then join them to make a string that would be a path to a file. I will use this string to fetch the files and... (4 Replies)
Discussion started by: kimskams80
4 Replies

3. UNIX for Dummies Questions & Answers

Basic unix command help plz

I was wondering what command lines i could use to do the following. 1. mail a file to a user with a subject line "HELLO". Also, send a Blind carbon copy to a different user? 2. Display the number of files AND directories in a given directory? 3. Display the last 5 files in a given... (4 Replies)
Discussion started by: tragic54
4 Replies

4. UNIX for Dummies Questions & Answers

unix script plz help

cdfcxvvbbvnbjmjnhjml. (1 Reply)
Discussion started by: sree11
1 Replies

5. UNIX for Dummies Questions & Answers

Need Unix Terminal for practise on Rental basis ...plz help!

Hey Guys,, Have just got started with Unix , I need UNIX Terminal to practise commands. Does any website host such services ? Happy Holidays... (9 Replies)
Discussion started by: rrover1977
9 Replies

6. UNIX for Dummies Questions & Answers

Plz help me.... window split in unix

how to split a window into two using curses in a text based chat application? (0 Replies)
Discussion started by: manju
0 Replies

7. Post Here to Contact Site Administrators and Moderators

Please help Moderators. Unix Masters.

Hi Vgersh, I have a quick problem that needs to be solved as soon as possible. I am using a script written by Reborg for doing a file manipulation on files. The script is in the posted forum with title "Script not working as desired". It was working fine but I have a strange situation where... (0 Replies)
Discussion started by: mhssatya
0 Replies

8. Shell Programming and Scripting

UNIX script problem ..Plz help ASAP

Hi folks, I have written down a UNIX script which actually FTP the file to other server. What is happening now , this script is not working only for 1 server , as it is working for 32 different FTP server . In this particular server , we are getting message “FTp:550 access denied”... (1 Reply)
Discussion started by: khan1978
1 Replies

9. UNIX for Dummies Questions & Answers

Unix masters please help newbie on "find" command

please help me figure out how to do this I wont lie, this is for a homework problem and I have searched on google for a long time and still can't figure out what to do. here is the problem So there's a folder let's say called "bare" in it, there are 10 dirs with names from "part1" through... (2 Replies)
Discussion started by: white_raven0
2 Replies

10. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies
Login or Register to Ask a Question