CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
invoking cshell using system command

 



nibalan
Novice

Jun 5, 2011, 10:46 PM

Post #1 of 5 (623 views)
invoking cshell using system command Can't Post

I am trying to invoke a source a .csh file in a shell script. But when I try to execute through perl through system comand it gives the error setenv command not found. system command invokes a bash shell. Is there anyway to invoke a shell through system command so that my sourcing works? Below is the code:

test.pl file contains:
system("sh cc.sh");

cc.sh file contains:
source start.csh

start.csh file contains:
setenv IMAGE c7200-i-ms


rovf
Veteran

Jun 6, 2011, 12:41 AM

Post #2 of 5 (617 views)
Re: [nibalan] invoking cshell using system command [In reply to] Can't Post

This is not a Perl question, but .... setenv is a csh/tcsh command, but you are invoking sh.


nibalan
Novice

Jun 6, 2011, 6:13 AM

Post #3 of 5 (610 views)
Re: [rovf] invoking cshell using system command [In reply to] Can't Post

Sorr for not mentioning properly in the question. What I was asking is, is there a possibility for invoking a c shell through system command so that my sourcing works?


FishMonger
Veteran / Moderator

Jun 6, 2011, 9:10 AM

Post #4 of 5 (608 views)
Re: [nibalan] invoking cshell using system command [In reply to] Can't Post

http://search.cpan.org/~jmcada/Env-Sourced-1.00/lib/Env/Sourced.pm-orig


rovf
Veteran

Jun 7, 2011, 9:09 AM

Post #5 of 5 (598 views)
Re: [nibalan] invoking cshell using system command [In reply to] Can't Post

Again: If you WANT cshell, you have to USE it. Your example invokes sh, not csh.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives