|
Re: Text Substitution and Script: msg#00050editors.sed.user
That worked. Thank you. As you may have inferred from my writing, I am at the beginning of the learning curve. It will be helpful to know under what circumstances can a script be executed simply by typing /home/> scriptname /home/> ./scriptname (what you have suggested) /home/> source scriptname (this has worked for me for other simple tasks) Once again thanks. Kind Regards, Venky Chakravarthy ********************* Date: Thu, 8 Dec 2005 16:59:26 -0800 (PST) From: shamrul ismawi <abb4h@xxxxxxxxx> Subject: Re: Text Substitution and Script hi, source will not execute/lunch the script.. It only will source/load the setting into your environment.. What u can do is, change your script to be executable 1)chmod 755 myscript Execute your script 2)./myscript --- Venky Chakravarthy <sas_geek1991@xxxxxxxxx> wrote: > 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 --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/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> |
|---|---|---|
| Previous by Date: | Re: Post-grep-like operations: 00050, Rob Simpson |
|---|---|
| Next by Date: | Re: GnuWin32 sed can handle double-byte character: 00050, Paolo Bonzini |
| Previous by Thread: | Re: Text Substitution and Scripti: 00050, shamrul ismawi |
| Next by Thread: | Post-grep-like operations: 00050, Rob Simpson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |