logo       

Text Substitution and Script: msg#00030

editors.sed.user

Subject: Text Substitution and Script

Sed Wizards,

I have a script that has worked well in a previous
job. However, the same script doesn't work in my
current SunOS: 5.8 setting. First there is a
difference in the way I call the script in my current
environment:

/home/myname/ 127> source myscript

previously I would simply do this as

/home/myname/ 127> myscript

What may be some of the system set-up differences that
necessitates the use of "source"? This difference per
se is not a big thing. Why does the following script
fail which used to work before? It does not recognize
"for" and "do".

cupsas01 /wwbdm/clin/proj/ca/183/maclib/dev/scripts/
124> more change1.script
#!/bin/sh
# Perform a global search and replace operation on all
*.sas files in this directory

for sas_filename in *.sas
do
sed 's/180/183/g' $sas_filename > temp_filename

mv -f temp_filename $sas_filename
done

Here is the how the script is called and the messages.

cupsas01 /wwbdm/clin/proj/ca/183/maclib/dev/scripts/
125> source change1.script
for: Command not found.
do: Command not found.
sas_filename: Undefined variable.

Thanks

Venky Chakravarthy




------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/dkFolB/TM
--------------------------------------------------------------------~->

--

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sed-users/

<*> To unsubscribe from this group, send an email to:
sed-users-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise