![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SFTP script issue | sdhalepaska | UNIX for Dummies Questions & Answers | 0 | 07-05-2007 10:24 AM |
| Issue with a shell script | vishalm | Shell Programming and Scripting | 4 | 12-23-2006 01:18 AM |
| Issue in my script | chiru_h | Shell Programming and Scripting | 4 | 09-27-2006 06:27 AM |
| please help ftp script issue | mgirinath | Shell Programming and Scripting | 4 | 04-28-2006 07:33 AM |
| Issue with sed in script | bthomas | Shell Programming and Scripting | 3 | 04-14-2005 01:21 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
script invokation issue
my problem is :
i have a small script automising the firefox invokation from my $HOME/bin directory: ********************** set FIREFOX_PATH='/tools/openbin/firefox/2.0.0.3/sparc-sun-solaris8' set GTK_LIB_PATH='/tools/openbin/gtk+/1.2.10/sparc-sun-solaris8/lib' set GLIB_LIB_PATH='/tools/openbin/glib/1.2.10/sparc-sun-solaris8/lib' setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$FIREFOX_PATH; setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$GTK_LIB_PATH; setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$GLIB_LIB_PATH; cd $FIREFOX_PATH ./firefox-bin & cd *********************** my question is case:1 when i invoke the script sourcing it source start_firefox.sh it works ********************** case:2 when i do from $hOME/bin tcsh start_firefox.sh .......it works ******************* case:3 but when i do from $HOME/bin..here the script resides ./start_firefox.sh error messages are coming like ********* csbu061 [mhalder] 206: ./start_firefox.sh ./start_firefox.sh: setenv: not found ./start_firefox.sh: setenv: not found ./start_firefox.sh: setenv: not found ./start_firefox.sh: ./firefox-bin: not found ....i can understand its working while sourcing but i am confused why its working in the 2nd case while its not working in the 3 rd case ...please make me clear abt this |
| Forum Sponsor | ||
|
|
|
|||
|
setenv is a tcsh built-in command, so you can only run it in a shell.
In cae 1, source tells your current (tcsh) shell to interpret and execute the commands in the file. In case 2, you are creating a new tcsh shell which interprets and executes the commands in the file. In case 3, it is not clear what is supposed to interpret the commands in the file, so it looks like a default sh shell is created to run them. setenv does not exist in sh,, hence the error message. Putting Code:
#!/bin/tcsh |
|
|||
|
i tried that way but its not working ..
in my shell csbu061 [mhalder] 277: cd /usr/bin /usr/bin csbu061 [mhalder] 278: ls | grep tcsh tcsh ****my script after introducing the shebang line #! /usr/bin/tcsh set FIREFOX_PATH='/tools/openbin/firefox/2.0.0.3/sparc-sun-solaris8' set GTK_LIB_PATH='/tools/openbin/gtk+/1.2.10/sparc-sun-solaris8/lib' set GLIB_LIB_PATH='/tools/openbin/glib/1.2.10/sparc-sun-solaris8/lib' setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$FIREFOX_PATH; setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$GTK_LIB_PATH; setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$GLIB_LIB_PATH; cd $FIREFOX_PATH ./firefox-bin & cd ***** from the shell in $HOME/bin csbu061 [mhalder] 117: pwd /users/mhalder/bin csbu061 [mhalder] 120: ls | grep 'start_a*' start_firefox.sh start_thunderbird.sh csbu061 [mhalder] 152: ./start_firefox.sh ./start_firefox.sh: setenv: not found ./start_firefox.sh: setenv: not found ./start_firefox.sh: setenv: not found ./start_firefox.sh: ./firefox-bin: not found csbu061 [mhalder] 153: |
|||
| Google UNIX.COM |