Hi, Platform : Red Hat Enterprise Linux v5.5 Bash : GNU bash, version 4.1.0(1)-release (x86_64-unknown-linux-gnu)
I have a script which uses getopts that I need to source in my interactive shell. The problem is that if I source it, getops behaves as if no arguments were passed into the script. Although, if I simply run the script in a sub-process, getopts works correctly. As an experiment, I echo'd all args prior to the getopts statement in the script, and when the script was sourced all args were correctly displayed. So I'm at a loss as to why getopts doesn't seem to work when the script is sourced. On a side note, there is some error checking being done within the script. I would like the script execution to terminate but leave the interactive shell running upon error detection (i.e., don't exit out of the terminal sessioni). Is there any way to accomplish that objective in bash? Regards, -- Mun