need solution for scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need solution for scripting
# 1  
Old 01-30-2008
need solution for scripting

hi all,

i would like to add on the print command to prompt user to enter a value and store inside the variable name as $inName
after that the value will replace the existing line for ${METRICA_DIR}/TechnologyPacks/Spool/2030324032
i'm new in scripting, could anyone give me some hint for sripting?

tmpfile=/tmp/tmpfile.$$

for file in loaderconfiguration*.xml
do
sed 's|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g' $file > $tmpfile
mv $tmpfile $file
done

thanks
# 2  
Old 01-31-2008
Shell Programming

Hi,

Iam new to Shell programming and i want to Display the same lines in a file which is appearing more than once.

Here is a file format,

WERTFRT|1234567890
ASDFFGU|1230986545
WERTFRT|1234567890
CVBNMKL|7685645385

Here 1st and 3rd lines are same and i need to select and write it in to seperate file.
please help me.

Thanks in advance.
nivas
# 3  
Old 01-31-2008
double quote

hi KKC,

please you double quote <"> instead of single quote <'> in your sed command, then it should be ok.
# 4  
Old 01-31-2008
Quote:
Originally Posted by summer_cherry
hi KKC,

please you double quote <"> instead of single quote <'> in your sed command, then it should be ok.
sorry i can't get you mean,
i wanted add on such like

print "what is your directory : ";
then the answer is storing to &inName

and the sed will replace the &inName to ${METRICA_DIR}/TechnologyPacks/Spool/2030324032

sed 's|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g' $file

Thanks in advance
# 5  
Old 01-31-2008
MySQL Clarification....

Hi KKC,

summer_cherry was asking you to replace the single codes in the sed command with double codes.

Code:
sed "s|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g" $file

==========
Thanks,
Karthikeyan.
==========
# 6  
Old 01-31-2008
Quote:
Originally Posted by Karthikeyan_113
Hi KKC,

summer_cherry was asking you to replace the single codes in the sed command with double codes.

Code:
sed "s|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g" $file

==========
Thanks,
Karthikeyan.
==========
hi

Smilie thanks for the advise~, what is the different withe replace the single codes in the sed command with double codes?Smilie

many thanks
# 7  
Old 01-31-2008
You can do something like this--

echo "Enter the file/dir name"
read file

then do the replacements here-
sed "s|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g" $file

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

2. Shell Programming and Scripting

need the solution

Write a program to print all prime numbers from 1 to 300. (3 Replies)
Discussion started by: paniruddha
3 Replies

3. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies
Login or Register to Ask a Question