Opening Child Shell & Executing a script in the same context


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Opening Child Shell & Executing a script in the same context
# 1  
Old 12-15-2011
Opening Child Shell & Executing a script in the same context

Hi,
Is the below possible (SHELL = tcsh)?
-- I want to write an 'alias' something like this -
alias set_my_work "setenv SOME_VAR;tcsh -i;source work_script.cshrc"
The intention is to run this alias and enter a child shell, at the same time ensuring that the work_script.cshrc is source-ed.
I have tried the above and it doesnt seem to work for me? Is there an alternative?
Please suggest
-- Abhishek
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing multiple child scripts - failing

Hi Folks - Happy Thursday! I have a need where I have Parent/Control script that calls multiple child scripts. The problem is, after the first child script is executed, it fails to move to the next script. I assume it's due to my script exit? For instance, in batch to return to the parent... (12 Replies)
Discussion started by: SIMMS7400
12 Replies

2. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

3. Shell Programming and Scripting

Generating & executing the SELECT and UPDATE clause dynamically using shell script

Hi All, I need to write one shell script. The requirement is as follows. a) I am having list the employee names in a file stored in /tmp directory location as below /tmp/emp.txt b) and the contents are as below cat emp.txt ravi raj ram arun c) I need to connect to sybase... (1 Reply)
Discussion started by: Gowtham_giri
1 Replies

4. Shell Programming and Scripting

Help with Shell Script opening and closing a program

REALLY new to this stuff, sorry. So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen. Anyway... (6 Replies)
Discussion started by: plsbbg
6 Replies

5. Shell Programming and Scripting

Help with opening another file from within a shell script

Hi, I am trying to open a file that I have created from withn a shell script and cannot seem to get it working. Does anyone have any ideas? Thanks. (2 Replies)
Discussion started by: tdsrogers
2 Replies

6. Shell Programming and Scripting

Perl - Parentheses & Context confusion

Hi Expert, Could you please explain why below two perl code get different result? Thanks a lot. sub test{ return (2,3,4,5,6,3,4,50); } ($a,$b)=(test); # 3,6 ($a,$b)=test; # 2,3 (2 Replies)
Discussion started by: summer_cherry
2 Replies

7. Shell Programming and Scripting

Opening file and executing an action

I want the script to read the directory I am running the script from and print the contents of any file that has GX in it's title. This is the code needed. But how do I combine it? #!/usr/bin/perl opendir(CURRENT,"."); @list = readdir(CURRENT); closedir(CURRENT); foreach $item (@list){... (4 Replies)
Discussion started by: DemonixX
4 Replies

8. Shell Programming and Scripting

Parent/child Korn shell script help

I have the following two Korn shell scripts: SHELL1.ksh #!/usr/bin/ksh nohup sas /abc/123/sasprogram1.sas & SHELL2.ksh #!/usr/bin/ksh ./SHELL1.ksh wait nohup sas /abc/123/sasprogram2.sas & My goal is to run SHELL1.ksh within SHELL2.ksh. SHELL1.ksh runs sasprogram1.sas. I would like... (1 Reply)
Discussion started by: sasaliasim
1 Replies

9. Shell Programming and Scripting

Getting Following problem when opening shell script (Very Urgent)

Hi All, Actually when i am trying to open my shell script file 1.sh then i am getting the following error. > vi 1.sh "/var/tmp/ExdNaarK" No space left on device Can anybody tell me that how to rectify it. It is very urgent. Because i am not able to do any work due to the above error. ... (1 Reply)
Discussion started by: sunitachoudhury
1 Replies

10. UNIX for Advanced & Expert Users

executing commands in child shell

I have to execute some commands after executing one command ( cleartool setview Tagname) Problem is that I write commands in script like this. echo "test1" cleartool setview tagname echo "test2" copy file1 file2 echo "test3" but when I execute script. Output --------- test1 If I... (1 Reply)
Discussion started by: udaykishore
1 Replies
Login or Register to Ask a Question
RESIZE(1)						      General Commands Manual							 RESIZE(1)

NAME
resize - set environment and terminal settings to current xterm window size SYNOPSIS
resize [ -u | -c ] [ -s [ row col ] ] DESCRIPTION
Resize prints a shell command for setting the appropriate environment variables to indicate the current size of xterm window from which the command is run. For this output to take effect, resize must either be evaluated as part of the command line (usually done with a shell alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the following alias could be defined in the user's .cshrc: % alias rs 'set noglob; eval `resize`' After resizing the window, the user would type: % rs Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a tempo- rary file and then read it back in with the "." command: $ resize > /tmp/out $ . /tmp/out Resize determines the user's current shell by first checking if $SHELL is set, and using that. Otherwise it determines the user's shell by looking in the password file. Generally Bourne-shell variants (including ksh) do not modify $SHELL, so it is possible for resize to be confused if one runs resize from a Bourne shell spawned from a C shell. OPTIONS
The following options may be used with resize: -u This option indicates that Bourne shell commands should be generated even if the user's current shell isn't /bin/sh. -c This option indicates that C shell commands should be generated even if the user's current shell isn't /bin/csh. -s [rows columns] This option indicates that Sun console escape sequences will be used instead of the VT100-style xterm escape codes. If rows and columns are given, resize will ask the xterm to resize itself. However, the window manager may choose to disallow the change. Note that the Sun console escape sequences are recognized by XFree86 xterm and by dtterm. The resize program may be installed as sunsize, which causes makes it assume the -s option. The rows and columns arguments must appear last; though they are normally associated with the -s option, they are parsed separately. FILES
/etc/termcap for the base termcap entry to modify. ~/.cshrc user's alias for the command. ENVIRONMENT
TERM set to "xterm" if not already set. TERMCAP variable set on systems using termcap COLUMNS, LINES variables set on systems using terminfo SEE ALSO
csh(1), tset(1), xterm(1) AUTHORS
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley) Copyright (c) 1984, 1985 by X Consortium See X(7) for a complete copyright notice. X Window System RESIZE(1)