LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2017, 09:51 AM   #1
sharanb
LQ Newbie
 
Registered: Feb 2017
Posts: 1

Rep: Reputation: Disabled
calling c shell from bash


Hello all,

I have several questions related to C and Bash shells, especially related to running scripts from combination of these two shells.

1) I would like to know how Linux executes a csh script when called from bash shell. Does it create a sub-shell in C and then run the script?
2) If I have environment variables in by Bash shell that are required by the Csh script then how these can be made visible when Csh script is executed?
3) Similar to question 2) above, if I have environment variables in C shell then would those be visible when C shell script executes?
4) The start-up profiles that are present in CSH or BASH shells, are these run only when a new login is done. Is it possible to get these set-up scripts to run just before a script is executed?

Sorry for so many questions but when I am trying to run certain scripts that are in one shell but I am having to use another shell to run from, I am having several basic questions. Earlier, I have always used CSH scripts but never called them from C shell.
 
Old 02-20-2017, 12:29 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Code:
csh -f script2
inside bash script maybe
http://stackoverflow.com/questions/2...om-a-sh-script

Last edited by BW-userx; 02-20-2017 at 12:31 PM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh from solaris 9 with a bash shell of 2.0 to suse 3.2 bash shell slufoot80 Solaris / OpenSolaris 3 09-19-2012 03:06 PM
ssh from solaris 9 with a bash shell of 2.0 to suse 3.2 bash shell slufoot80 Solaris / OpenSolaris 1 09-19-2012 01:19 PM
[SOLVED] calling a shell script from exec. ankitm Programming 4 04-09-2012 06:05 AM
Calling a bash shell script from within another script dedman Linux - Software 7 04-24-2010 08:53 PM
c++ calling bash? adam_boz Programming 4 10-23-2002 12:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration