I was actually thinking why i can't get the same result using sed? Can sed use to substitute?
sed -i 's/${old_seq}/${new_seq}/g' ${SEQ_FILE} to replaces this statement
perl -pi -e "s/${old_seq}/${new_seq}/g" ${SEQ_FILE}
Thanks Annihilannic, the problem solved. It is due to the pipe.
new_seq=${seq_code}"\\|"${t_seq_number_new}
perl -pi -e "s/${old_seq}/${new_seq}/g" ${SEQ_FILE}
it works fine. Now it is updated, but it duplicate the result.
original :
Avnet FFS|00000000001
Avnet SCS|00000000001
After execute:
::::::::::::::
ref_id.dat
::::::::::::::
Avnet FFS|00000000002|Avnet FFS|00000000002
Avnet SCS|00000000001
Hi,
Is there anyway to use variable in the following case?
The file is not able to update.
perl -pi -e 's/${seq_detail}/${new_seq}/g' ${SEQ_FILE}
alternatif, i try to use sed, but still the file is not updated.
sed -n -e 's/${seq_detail}/${new_seq}/g' ${SEQ_FILE}
Can anyone help to...
Hi
I am looking for a way to shorten the following script, is there any other options?Thanks.
if [ $t_seq_number -le 9 ]
then
t_seq_number1="0000000000"$t_seq_number
else
if [ $t_seq_number -le 99 ]
then
t_seq_number1="000000000"$t_seq_number...
This is my test usage of awk and I face the error of "illegal statement". I don't really where goes wrong?
can anyone help? Thanks.
#! /bin/sh
temp="temp"
cat test.dat |awk \
'BEGIN {FS="|"}
{
if [$14 != ""]; then
team_name=$14
else...
This is the script that i have written ::
I have tried to use & to let it process in background mode, but still i need to press enter to end executing the script and go back to my unixprompt.
start_informatica(){
cd /apps/dm/informatica/repositoryserver/
pmrepserver &
sleep 20
cd...
Do anyone knows what is the refresh command (that simulate enter key) that can be used in shell scripts?
I have a shell script, so whenever after executing the script, I need to press ‘enter’ to get back the unixprompt … or else the system will still stay there.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.