source the csh into the bin/sh

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers source the csh into the bin/sh
# 1  
Old 08-16-2016
source the csh into the bin/sh

I tried to source the csh file into the bin/sh(input file is srcinput.sh ).

Its(csh -f ...csh) not working.

I tried to source like
Code:
csh -f  D:/sample/expand/env.csh


env.csh sets the environment and it source another .csh file using
source fname.csh.

fname.csh it sets one environement.

input file is srcinput.sh calls env.csh.It calls fname.csh.

I am working in linux.


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!
Don't hijack other members' threads!
Be as clear and as precise as possible, and supply sufficient information, with your specification!

Last edited by RudiC; 08-16-2016 at 04:06 PM.. Reason: Moved thread. Added CODE tags.
# 2  
Old 08-16-2016
Hello and Welcome to The UNIX and Linux Forums!

Please read the our FAQ on how to post new threads in the forums.

As a registered user you can go to any forum where you have permission to post and create new threads, view threads and leave replies. You should always search the forums before posting a new thread (Google Site Search).

To create a new thread, click on a forum you would like to post in, for example, UNIX for Dummies Questions & Answers, and then click on the new thread icon Image

To reply you have a few options. You can click on the 'Post Reply' button Image and add a new post to the end of the thread. Alternatively, you can leave a quick reply in a quick editor box listed below the posts in the thread.

If you have further questions on forum operations, do not send email or private messages (PMs) to us. You are required to post these questions here:

Post Here to Contact Site Administrators and Moderators

Enjoy, Learn and Teach!

The UNIX and Linux Forums
# 3  
Old 08-16-2016
Perhaps there is D:/sample/expand/env.sh and in your srcinput.sh script you can do
Code:
. D:/sample/expand/env.sh

?
Alternatively, create a wrapper script srcinput.csh like this
Code:
#!/bin/csh -f
source D:/sample/expand/env.csh
set me="$0"
exec "$me:h"/srcinput.sh $*:q

The $me:h works if the srcinput.csh is placed next to the srcinput.sh script.
If you run the (executable!) wrapper script, it passes the environment to the exec'ed srcinput.sh.

Last edited by MadeInGermany; 08-16-2016 at 05:22 PM..
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Csh doesn't source init files completely

I have a strange problem with (t)csh since the latest opensuse/tumbleweed upgrade. csh and tcsh don't source the init files completely. They seem to terminate after sourcing the first nested file. They process the code in /etc/csh.cshrc until they find a command like source... (3 Replies)
Discussion started by: heiko123
3 Replies

2. UNIX for Beginners Questions & Answers

>& >&! in /bin/csh

i am new player in linux what does mean ">& and >&!" in script or command line? thanks (4 Replies)
Discussion started by: abdossamad2003
4 Replies

3. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

4. Shell Programming and Scripting

#!/bin/csh -f :: What does it mean

Hi, I have a script which I need to modify. It contains the following statement at the beginning - 1. What does this mean ? #!/bin/csh -f 2. If I run the following code in a script on C SHELL it runs normally. host=0 if ; then host="<<something>>" fi But, in the script... (7 Replies)
Discussion started by: angshuman_ag
7 Replies

5. Shell Programming and Scripting

how to source csh script in tcl script

i have atcl script and i want to source a csh script to reflect changes done by script ........ Please help....... (0 Replies)
Discussion started by: paragarora47
0 Replies

6. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

7. Shell Programming and Scripting

Why does my /bin/csh take longer than /bin/perl?

Okay, so I have two "Hello, world!" scripts, "test.pl" and "test.sh". #!/bin/perl -w use strict; print "Hello, world!\n"; #!/bin/csh echo Hello,\ world! When I run test.pl, it runs instantly, always. When I run test.sh, it takes anywhere between 4 and 22 seconds! I'd like to know what... (3 Replies)
Discussion started by: acheong87
3 Replies

8. Shell Programming and Scripting

#/usr/bin/csh -f not working as expected?

Hey everyone, A coworker of mine has written a csh script that starts with #!/usr/bin/csh -f. It's my understanding that the -f should skip the .cshrc and .login files, but here's the problem: In the script "line" is used, and I happen to have a "line" in my ~/bin. When the script is ran my... (4 Replies)
Discussion started by: effigy
4 Replies

9. Shell Programming and Scripting

CSH CGI-BIN question ?

Hi, 1. How to Write csh CGI-BIN script which return a web page which show the environment of the executed script ? 2. How do we read command line on csh and ksh ? Thank's (2 Replies)
Discussion started by: 7eleven
2 Replies

10. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies
Login or Register to Ask a Question