If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > shell built-in command in scripts

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-03, 17:31
mjorg mjorg is offline
Registered User
 
Join Date: Apr 2003
Posts: 8
shell built-in command in scripts

shell built-in command
How do you run a "shell built-in command" inside a Unix shell script?

I'm trying to source a startup file but when I execute the file an error occurs

#!/bin/sh
echo "start"
source .cshrc
echo "finish"

colt 27% temp
start
temp[3]: source: not found
finish
colt 28%

Is there anyway to do this?

Thanks

Marty
Reply With Quote
  #2 (permalink)  
Old 10-15-03, 08:43
EZEE! EZEE! is offline
Registered User
 
Join Date: Oct 2003
Location: East Coast of South Africa
Posts: 10
I notice that you are trying to source a c shell source while starting the script in sh. any reason for this? try /bin/csh and use

source filenale (without the .cshrc - this is automatic)

Can you expand on what you are trying to do. Are you looking to access the parent shell or the child shell?

Last edited by EZEE!; 10-15-03 at 08:46.
Reply With Quote
  #3 (permalink)  
Old 10-16-03, 17:48
mjorg mjorg is offline
Registered User
 
Join Date: Apr 2003
Posts: 8
I'm writting a script that sources the .cshrc so the user does not have to do it manually.

The .cshrc contains many setenv. Is there away in a script to run set these?

Thanks

Marty
Reply With Quote
  #4 (permalink)  
Old 10-17-03, 02:44
karthi_tvr karthi_tvr is offline
Registered User
 
Join Date: Oct 2003
Location: Singapore
Posts: 12
Two ways :-

1. Use #!/bin/sh on the first line of the script and do a
. /xyz/.profile

2. Use #!/bin/csh on the first line of the script and do a
source /xyz/.cshrc
__________________
Thanks and Regards
Karthik R
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On