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..

Recommended Answers

All 5 Replies

#! 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? :?:

thank you so much!

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?

It is also called a "shebang":
http://en.wikipedia.org/wiki/Shebang_(Unix)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.