how to do that!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to do that!
# 1  
Old 09-14-2006
how to do that!

i have a file calld dir.list, it is looking like that:
@/cav
@/mnt
@/syscat/bar
/tts
/usr/cach
/bar

what i want is to write a script that will chack to see if the line begin with the @, then it should add $x to tne name without the @, like
@/cav will result in /xxxxxxx/cav......
and lines that all ready have the / signe, not to do nothing.

thanks
# 2  
Old 09-14-2006
Try...
Code:
awk -v x="/xxxxxxx" '{sub(/^@/,x); print}' dir.list

# 3  
Old 09-14-2006
str="/xxxxxxx"
sed "s%^@%$str%" file
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question