Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Look at the following lines of code:

. $IPKG_INSTROOT/etc/functions.sh

initscript=$1

action=${2:-help}

shift 2

What does the action command do?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Action is setting it's value to second argument of the script. If second argument is missing then it's set to "help".

share|improve this answer
    
What would be the output of 'help'? Will it open some kind of help file which is already present? –  Akshaa Oct 8 '12 at 6:28
    
It depends on the rest of the code, paste the missing code. If have to guess, this is an init script that have a special action "help" that show usage, and with that line there instead of dying and showing usage help, it just set it to 'help' and let the code proceed, which will produce same result. But without code, that's just a random guess. –  Valor Oct 8 '12 at 6:34
    
sorry dude, the code is confidential. But, yeah..I got it. Thanks :) –  Akshaa Oct 8 '12 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.