11-24-2004
Spawning a shell script
Quote:
Originally posted by bhargav
Absolute and relative path for directoroes anf files:
a).Be sure to use absolute PATHs for directories/files instead of relative PATHS in the scirpt.
b).Do n't use absolute PATH in case you are saving some data into the files or creating temp files and making use of them in the flow of the script.
For temp savings it should be good idea to use relative directories
because u want to run the script from 2 different places at the same time.
c).And as RTM said... u should have the same env (PATH .. etc )settings in both the places before running the script to get the same results.
The idea is to simulate unix operation, if many users type the command ls, many output will be displayed for all the users.
I want to do something similar.
Regards
10 More Discussions You Might Find Interesting
1. Solaris
Hi all,
First time poster here. Great forum.
Im trying to spawn new shells and pass commands to the new shells in a solaris 8 environment utilizing dtterm and its option -e.
I can successfully spawn a window utilizing the following code:
/usr/dt/bin/dtterm -display <ip.address> &
... (4 Replies)
Discussion started by: Rocketman8541
4 Replies
2. Shell Programming and Scripting
Hi all,
Im trying to figure out what the command would be to launch terminal windows from the command line in Open Step 4.2 . (looking for something similiar like /usr/bin/xterm or /usr/bin/dtterm etc)
echo $TERM = vt100
echo $SHELL = /bin/csh
Im combing over alot of OpenStep 4.2 and... (3 Replies)
Discussion started by: Rocketman8541
3 Replies
3. UNIX for Advanced & Expert Users
We have a program (reader) that reads audio files in a real-time continuous stream from a sender program. If the reader gets weird we want the sender to be able to send one command that will stop the current reader and start a new one that will be able to continue reading in the files. The sender... (9 Replies)
Discussion started by: laforge
9 Replies
4. Programming
I want to spawn n child processes but have two different classes..with the foremost one forking/spawning the child process and the latter performing a function w/ the spawned processes.
I can do this in one class with an if statement and the simple
if((pid=fork())==0) //child process
{
... (1 Reply)
Discussion started by: StrengthThaDon
1 Replies
5. Shell Programming and Scripting
Hi,
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks (5 Replies)
Discussion started by: neeto
5 Replies
6. UNIX for Advanced & Expert Users
Hi - I need help. My user crontab is spawning multiple at processes (and multiple mencoder program starts, that exit, then restart, repeatedly), locking up my system.
For example I have this entry in my crontab:
$ sudo crontab -u victoria -e
* * * * * ~/recordings/pvr1
* * * * *... (10 Replies)
Discussion started by: gstuart
10 Replies
7. Shell Programming and Scripting
When trying to get the correct syntax to cron a script that creates a file with the date stamp as its output, sometimes I get these results:
- from the command line, I may encounter an error that leaves me without the usual $ prompt. Am I in a new shell? I try to exit it with 'exit' or :q! and... (1 Reply)
Discussion started by: landog
1 Replies
8. Shell Programming and Scripting
Hi,
I am having a shell script which has a while loop as shown below.
while
do
sleep 60
done
I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Discussion started by: chekusi
2 Replies
9. Solaris
Hi,
I am having a shell script on Solaris 10 which has a while loop as shown below.
#!/usr/bin/ksh
#
while
do
sleep 60
done
Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies
10. Shell Programming and Scripting
Hi there,
I would like to understand the purpose of spawning a TTY shell?
Does it mean that it will help to open up a new Windows on the current interactive shell such that when the session gets lost the other won't
Any explanation will be helpful. (3 Replies)
Discussion started by: alvinoo
3 Replies
LEARN ABOUT OPENSOLARIS
script
script(1) User Commands script(1)
NAME
script - make record of a terminal session
SYNOPSIS
script [-a] [filename]
DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the
record is saved in the file typescript. See WARNINGS.
The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends
when the forked shell exits or when Control-d is typed.
OPTIONS
The following option is supported:
-a Appends the session record to filename, rather than overwriting it.
NOTES
script places everything that appears on the screen in filename, including prompts.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5)
WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a
privileged user, that is, root. Be sure that typescript is not a link before running script.
SunOS 5.11 30 Jan 2004 script(1)