The problem is:
The only EXPORTED variables are copyed.
I need many functions and declared not exported variables.
I am running functions which change and define variables.
Some of them need to be run in separate process, in '()': like >(funct_boo)
I do not want redeclare all functions, aliases and variables in the new process
The return() I have used, but it is not cover my situation.
There is a stack of functions, if somewhere something has not-0-return I need to stop execution of all stacked function, but do not kill the shell.
Return works only for one function.
bash has an -a option to automatically export all variables and functions, dunno if this is a bashism but I would guess it's POSIX. Try "set -a" at the top of the script.
In bash, it seems you can't export aliases. All the more reason to use functions instead of aliases.
bash has an -a option to automatically export all variables and functions, dunno if this is a bashism but I would guess it's POSIX. Try "set -a" at the top of the script.
In bash, it seems you can't export aliases. All the more reason to use functions instead of aliases.
Thank you, ERA, for advise, but I could not have it work.
Not sure where 'set -a' should be used:
- in original shell, where function and variables are defined and where new shell is started
- whith start shell command, like : >bash -a
- in new shell after starting
I have tried all 3 way but do not have any success.
Linux System having all Perl, Python, PHP (and Ruby) installed
From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file
eg
eg
a Shell script run in a case statement call to run a php file, also Perl or/and Python file???
Like
#!/usr/bin/bash
....
....
case $INPUT_STRING... (1 Reply)
I am working on converting shell to Perl script. In shell we have built in function
trap
Do you know alternative in Perl or actually we don't need it?
Thanks for contribution (3 Replies)
Hi,
I am on AIX 7.1 and when I try to login to my account and sudo to other generic account (mqm user) my ssh session just hungs.
==================
$ id
uid=16150(sxp) gid=179(rax) groups=1179(raxs)
$
$
$ sudo su - mqm
Password:
--------
Changed username to: mqm
--------
.... (1 Reply)
Can someone point me to the right command to to run another shell on top of your default shell?
Thanks
PS If admin sees this It is not home work. I am old man who wants to learn unix in my spare time. I CURRENTLY DO NOT GO SCHOOL, COLLEGE OR UNIVERSITY. (2 Replies)
Hi guys,
I have a simple question, I want to store the output of the following command:
As you can see it is running all the time, and we get a new line every 3sec.
I just want to store these new lines into a single variable, so I can use it into a script.
To clear the screen, and... (4 Replies)
Hi,
I am using HP-UNIX.
I have a requirement as below
I have to change env twice like:
cadenv <env>
cadenv <env>
ccm start -d /dbpath
ccm tar -xvf *.tar
ccm rcv ....
mv *.tar BACKUP
but after I do the first cadenv <env> , I am unable to execute any of the later commands .
... (6 Replies)
i have a small problem getting a batxh shell script to run in shell
this is the code
the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command
this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Hi ,
I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell.
So scenario is that
- I need to have one shell script which is ran as a part of crontab
- in this shell script I need to do a... (2 Replies)
Hello all..
I just want to login(ssh) to another system and run 'poweroff' command.
This must be accomplished via a shell script($sh Myhalt host_name) and not from my bash!!
Any idea???
:rolleyes: (1 Reply)