Shell scripting: Way to parse parameters from command line

Posted by bguiz on Super User See other posts from Super User or by bguiz
Published on 2010-03-12T03:53:17Z Indexed on 2010/03/12 3:57 UTC
Read the original article Hit count: 702

Filed under:
myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory

Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?

© Super User or respective owner

Related posts about linux

Related posts about shell