hi. I'm a newbie in shell scripting as well as the *nix OS.

I just wanna ask about the symbol #! that I saw in many shell script examples. For instance, [B]#![/B]/bin/bash . What does the #! symbol means?

What's the meaning of $1, $2, $3 symbols?
and what does the symbol ~ (like in cd [B]~[/B][I]user_name[/I] ) means?

I'm sorry if this question sounds stupid and if my English is bad. English isn't my native languange.

Please help..

7 Years
Discussion Span
Last Post by sknake

#! is a built-in exec. The shell script is executed in the shell declared on this line.

$1 etc are the arguments provided on the command line (or provided on the function call when used inside a function)

~ means home directory.

And I hope this is not homework.


no. this isn't homework. I saw it in the facebook's puzzle master discussion. I'm using windows, and never use *nix OS before. thanks for your help. :)

by the way, I forgot to ask about $< and $@ symbol. Do you know what it means? :?:

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.