The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 01-08-2009
Nicol Nicol is offline
Registered User
  
 

Join Date: Sep 2003
Location: Paris
Posts: 128
Hi ,

i used with success the sed command : ( in the date value the slash is protected by \ )

cat crontab-test|sed -e "s/Modifie le : 20\/06\/08/Modifie le : 11\/22\/33/g"

but when i want to put the values in variables

j_modif_old="20/06/08"
j_modif_new="11/22/33"

cat crontab-test|sed -e "s/Modifie le : ${j_modif_old}/Modifie le : ${j_modif_new}/g"

i have the following error :
sed: Function s/Modifie le : 20/06/08/Modifie le : 11/22/33/g cannot be parsed.

how can i do this , protecting the "/" when parsing ?

thanks in advance
Christian