| | |
*nix shell script symbols
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 10
Reputation:
Solved Threads: 0
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,
What's the meaning of $1, $2, $3 symbols?
and what does the symbol ~ (like in
I'm sorry if this question sounds stupid and if my English is bad. English isn't my native languange.
Please help..
I just wanna ask about the symbol #! that I saw in many shell script examples. For instance,
#!/bin/bash . What does the #! symbol means?What's the meaning of $1, $2, $3 symbols?
and what does the symbol ~ (like in
cd ~user_name ) means?I'm sorry if this question sounds stupid and if my English is bad. English isn't my native languange.
Please help..
Last edited by curi0x; Jul 6th, 2009 at 10:04 am.
#! 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.
$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.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
•
•
I just wanna ask about the symbol #! that I saw in many shell script examples. For instance, #!/bin/bash . What does the #! symbol means? http://en.wikipedia.org/wiki/Shebang_(Unix)
![]() |
Similar Threads
- Sending email from a shell script (Shell Scripting)
- How to su properly in a shell script (Shell Scripting)
- Problem with variables in Windows shell script (Windows NT / 2000 / XP)
- Using find in a bash shell script (Shell Scripting)
- Shell Script for Gnome 2.6 Print Manager. (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: Change standard include path
- Next Thread: is this perl doable in shell?
| Thread Tools | Search this Thread |






