I've a little problem with one of my ksh scripts and I manage to narrow it to the script here:
The result of this script is
whereas I'm waiting for
Could someone explain me why running the function in a subshell result in a malfunctionning of getopts ?
Thanks ...
I tried with bash and it works ...
I found those bugreports that seems to address the same issue:
bugzilla.redhat.com/show_bug.cgi?id=443889
bugzilla.redhat.com/show_bug.cgi?id=541654
This may be corrected with two ksh bug-fixes
rhn.redhat.com/errata/RHBA-2009-1256.html
rhn.redhat.com/errata/RHBA-2010-0234.html
I'l try to see with my sysadmin if he can update ksh.
If not, as I'm tied with ksh, I'll be doomed to find a workaround
(Sorry I couldn't use the full url as I don't have enough posts on this board )
Hey I have a shell script that is like this:
(
echo "hi!"
##DO SOMETHING
)&(
sleep 5
##EMAIL RECIPIENTS VARs
ERECIPIENT3="email.com"
echo "Connection on status: is Down"|mail -s "Subject:" ${ERECIPIENT3}
kill -- -$$
)
This isn't working anyone know why? mail won't go out from... (12 Replies)
Hello,
I am firing off some scripts from a main script,
cd B/
./EV_B_m0-m200_hex1.sh &
./EV_B_m0-m200_hex2.sh &
wait
...more
It would be useful to put a bit of time between the two to clean up the output to the terminal.
I think this would work,
cd B/
... (4 Replies)
Hi All,
I am trying to create a shell script which runs on my linux machine.
The requirement is so that,
ade createview xyz -> this steps creates a view
ade useview xyz -> we are entering inside the view
ade begintrans -> begin a transaction
My script has following code :
lets say... (2 Replies)
Hi,
the getopts doesnt seem to be working in the subshell of the ksh. when I echo $@ and $* from the subshell it shows nothing. even when I am capturing the parameters from the outer shell and passing while invoking the file then I am still not getting it properly.
the below code is in the... (9 Replies)
Hi All,
I would like to improve my bash scripting skill and found a problem which I do not understand. Task is to search and print files in directory (and subdirecories) which contains its own name. Files can have spaces in name.
This one works fine for files in main directory, but not for... (4 Replies)
I am calling a script from with another script and reading its output one line at a time (using <childscript> | while read line) in the parent script. If the output exceeds a predefined number of lines I want to kill the child shell from within the parent shell.
I decided to print the process ID... (2 Replies)
I have a shell script which is invoked by passing an argument. The outer shell script calls another subshell and I want the argument passed down to flow down to the subshell.
E.g
Invoking a shell ======>> abc_refresh.ksh NM
Below is the content of abc_refresh.ksh
Value1=$1... (7 Replies)
Hi All,
I need some info.
Could you please tell me how to use the variable of a parent shell in the subshell. Also can we modify the variable in the subshell ? If yes, will the modified variable visible in the parent shell
I am using two prg.
a.sh
#!/usr/bin/ksh
temp_var="abhishek"... (3 Replies)
The profile of the user is empty. Then before I run the script I want I run a parameter file that populates the variables for oracle.
ORACLE_HOME
ORACLE_BASE
ORACLE_SID
PATH
etc ...
But it seems that these variables are not making it to the shell I am in because when I do an echo on... (6 Replies)