LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   insmod command variables in a script (https://www.linuxquestions.org/questions/linux-general-1/insmod-command-variables-in-a-script-398971/)

fpb 01-03-2006 05:05 AM

insmod command variables in a script
 
What does the "$*" and "|| exit 1" in the command:

insmod ./$module.o $* || exit 1

mean? Google-ing for "linux $*" or "insmod $*" doesn't seem to uncover any answers. This is part of a script to load a module in 2.4.

Thanks!

vls 01-03-2006 05:33 AM

$* are the positional parameters (or command line arguments) to the script.
example: script arg1 arg2
arg1 and arg2 get put in $*

|| is the 'or' operator. If the insmod fails, the script exits with a code of 1, which is the standard exit code for failure. If the insmod succeeds the exit 1 is skipped.

fpb 01-03-2006 07:29 PM

Cool. That was easy to understand & very helpful.

Originally I'd thought it was the Makefile special macro $* that is the prefix shared by target & dependent files, but that doesn't make sense in the script of course.

Thanks a lot vls! Happy New Year!


All times are GMT -5. The time now is 11:50 PM.