- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- running a csh script from a ksh script, and stayin...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2004 06:09 AM
тАО10-20-2004 06:09 AM
running a csh script from a ksh script, and staying in the same shell...
My problem is that I dont know if the script, which is a parameter, is in ksh or csh.
In ksh there is no problem since I can just write ". scriptToRun".
But if the script is in csh, how can I make "source" on it?
Thanx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2004 06:34 AM
тАО10-20-2004 06:34 AM
Re: running a csh script from a ksh script, and staying in the same shell...
the solution is to not write stuff in csh's
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2004 06:53 AM
тАО10-20-2004 06:53 AM
Re: running a csh script from a ksh script, and staying in the same shell...
Why is it important that the csh script run in the same shell as your ksh script?
If it is a matter of retaining variables between the 2 scripts, then their are other ways to do.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2004 06:59 AM
тАО10-20-2004 06:59 AM
Re: running a csh script from a ksh script, and staying in the same shell...
#!/usr/bin/ksh
but in the case of sourcing a file, csh will read the commands in the ksh script and interpret them accordingly. In csh, the commnand is source as in:
source scriptToRun
I would make sure every script is correctly written with the above header. Ideally, csh should never be used for server work. Do you have an example of the ksh scriptToRun?
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2004 07:15 AM
тАО10-20-2004 07:15 AM
Re: running a csh script from a ksh script, and staying in the same shell...
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-23-2004 06:46 PM
тАО10-23-2004 06:46 PM
Re: running a csh script from a ksh script, and staying in the same shell...
Thanx for the quick answers.
Ok...why do I want to run a csh script when mine is in ksh?
Because the 2nd script is given by the client, to initialize the environment, and I did not want to ask him to write like this or like that.
What is important for me, is to get in the ksh parent script, my script, all the variables that were initialized in the client script that I have to run...without caring if the client script is written in csh, ksh or something else...
any idea how I can export to my shell the variables of the 2nd script, without caring which kind of script it is?
I have the feeling that there is no way for that and that I'll have to write in the release notes that the script should be written in ksh...:-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 02:29 AM
тАО10-25-2004 02:29 AM
Re: running a csh script from a ksh script, and staying in the same shell...
client.csh
----------
set myvar1=hello
set myvar2=world
your.csh
--------
source client.csh
tmpname=/tmp/dummyfile
echo "myvar1=$myvar1" >$tmpname
echo "myvar2=$myvar2" >>$tmpname
your.ksh
--------
#!/usr/bin/ksh
csh your.csh
. /tmp/dummyfile
This works by saving the environment variables into a /tmp file and then sourcing that file into the ksh environment.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 03:05 AM
тАО10-25-2004 03:05 AM
Re: running a csh script from a ksh script, and staying in the same shell...
Well, if I knew what are the variables initialized, I was doing that...But I have no idea...
I guess there is no way to export the variables of a csh script, from a ksh script, without knowing the name of those variables...
Thanx anyway
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2004 03:35 AM
тАО10-25-2004 03:35 AM
Re: running a csh script from a ksh script, and staying in the same shell...
echo "source ttt\nset" | csh | sed -e 's/\t/=/' -e '/^path/d' >/tmp/dumyfile
. /tmp/dumyfile
This will slurp in all variables generated by the csh script.
HTH
-- Rod Hills
(PS- Points are a way to indicate how well a solution fits your problem.)