shell script + change shell && continue
Hi
Is it possible to have a script which will execute this: Quote:
thanks |
dont think so.
|
hii,
if you rean the man page exec, it clearly states that it replaces the current shell your can read the man page for the exec command it is as given below : If command is specified, it replaces the shell. No new process is created. The arguments become the arguments to command. If the -l option is supplied, the shell places a dash at the begin- ning of the zeroth arg passed to command. This is what login(1) does. The -c option causes command to be executed with an empty environment. If -a is supplied, the shell passes name as the zeroth argument to the executed command. If command cannot be executed for some reason, a non-interactive shell exits, unless the shell option execfail is enabled, in which case it returns failure. An interactive shell returns failure if the file can- not be executed. If command is not specified, any redirections take effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1. so it is no possible using exec command ... you can write a c program fork a process and exec it using the scripts you want is the possiblity i seee... Hitesh |
ok thanks, that was what i was thinking,
|
Why don't you set your first line of script with :
#!/bin/bash --login |
Thats a good point but i think the way to go now is write a c program to hold what im doing together. Im just learning how shell scripts work and i have a task which chains together a number of scripts, i guess im finding out what can and can't be done with scripts
thanks |
All the best .. do post as many questions as you can.. we will be happy to learn from your experiences and share each others knowledge and experiences...
|
All times are GMT -5. The time now is 11:59 PM. |