If the first line is exactly as you've shown it here and you're executing the line from the console in a different directory than you're running the script from then the most likely explanation is that there is a file in the script directory that has a one-character filename which is one of the characters in "driver".
The shell sees [driver]
as a potential glob and tries to match it to filenames in the directory. If it finds one that matches, it substitutes the name for the glob. For example, the resulting command that is run might look like:
update_drv -a -i '[myhardware]' d
which might have unintended effects.
In order to prevent this, put quotes around the last argument as you have around the preceding one.
However, I suspect that your bracketed strings are merely place holders and you've omitted information which may be useful in trying to come up with potential solutions. By the way, the Oracle documentation seems to indicate that a reboot is likely needed anyway.
In order to troubleshoot your script, add set -x
near the top so you can see a trace. You can also add a line like echo "here"
after the first (or any) line to see if your script makes it that far. It's really odd that you're not getting any error messages.
Another possibility is a corrupted binary or bad hardware, but that seems unlikely since it works on the command line.
Another, possibly primary, consideration is that the environment differs between your console session and the script. You don't say whether you're running your script from the command line or by cron
. It's often the case under these circumstances that the PATH
is different or some environment variable is set differently or unset. One way to diagnose that is to add a command like set > script_env.out
in your script and do set > cons_env.out
at the command line and diff
the two files and look for significant differences. Are you running the script and the console command as different users? That has an effect as well.