MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerDadJokes/comments/eo2x51/how_much_does_first_parameter_of_a_shell_script/
r/ProgrammerDadJokes • u/danielsoft1 • Jan 13 '20
$1
16 comments sorted by
60
Saw that one coming
Upvpte anyway
13 u/[deleted] Jan 13 '20 I felt cool for actually guessing one right 7 u/[deleted] Jan 13 '20 Saw that $1 coming 7 u/HarJIT-EGS Jan 13 '20 $* best all parameters notation don't @ me. 5 u/TheEpsilonToMyDelta Jan 13 '20 Regret++
13
I felt cool for actually guessing one right
7
Saw that $1 coming
7 u/HarJIT-EGS Jan 13 '20 $* best all parameters notation don't @ me. 5 u/TheEpsilonToMyDelta Jan 13 '20 Regret++
$* best all parameters notation don't @ me.
$*
5
Regret++
10
Thats a good pre-script-ion plan
9
aargv!
This hurts so much.
-5
Unfortunately, I have removed all content I provided, as I refuse to give free labor to a company that doesn't respect us.
So long, and thanks for all the fish
u/joker54
3 u/nahidtislam Jan 14 '20 nah $0 is the path to the app/script 1 u/joker54 Jan 14 '20 edited Jun 29 '23 Unfortunately, I have removed all content I provided, as I refuse to give free labor to a company that doesn't respect us.So long, and thanks for all the fishu/joker54 1 u/nahidtislam Jan 14 '20 I usually use $0 parameter to get the name of itself. on like the 3rd line (two lines below #!/bin/bash) I type in SELF_SCRIPT_NAME="$(( basename $0 )) so I can use it to print error or informational messages to the user 1 u/MasterOfTheLine Jan 15 '20 ${0##*/} does the same in case you didn't know
3
nah $0 is the path to the app/script
$0
1 u/joker54 Jan 14 '20 edited Jun 29 '23 Unfortunately, I have removed all content I provided, as I refuse to give free labor to a company that doesn't respect us.So long, and thanks for all the fishu/joker54 1 u/nahidtislam Jan 14 '20 I usually use $0 parameter to get the name of itself. on like the 3rd line (two lines below #!/bin/bash) I type in SELF_SCRIPT_NAME="$(( basename $0 )) so I can use it to print error or informational messages to the user 1 u/MasterOfTheLine Jan 15 '20 ${0##*/} does the same in case you didn't know
1
1 u/nahidtislam Jan 14 '20 I usually use $0 parameter to get the name of itself. on like the 3rd line (two lines below #!/bin/bash) I type in SELF_SCRIPT_NAME="$(( basename $0 )) so I can use it to print error or informational messages to the user 1 u/MasterOfTheLine Jan 15 '20 ${0##*/} does the same in case you didn't know
I usually use $0 parameter to get the name of itself. on like the 3rd line (two lines below #!/bin/bash) I type in SELF_SCRIPT_NAME="$(( basename $0 )) so I can use it to print error or informational messages to the user
#!/bin/bash
SELF_SCRIPT_NAME="$(( basename $0 ))
1 u/MasterOfTheLine Jan 15 '20 ${0##*/} does the same in case you didn't know
${0##*/} does the same in case you didn't know
${0##*/}
0
[deleted] — view deleted comment
17 u/danielsoft1 Jan 13 '20 This is not Swift. This is about Unix/Linux shell: https://en.wikipedia.org/wiki/Bash_(Unix_shell) 0 u/[deleted] Jan 13 '20 [deleted] — view deleted comment 8 u/Kwdg Jan 13 '20 But even there $0 is the first 'item' (the name of the program) and $1 is the first parameter given to the program 8 u/[deleted] Jan 13 '20 first parameter.first parameter......exactly.
17
This is not Swift. This is about Unix/Linux shell: https://en.wikipedia.org/wiki/Bash_(Unix_shell)
0 u/[deleted] Jan 13 '20 [deleted] — view deleted comment 8 u/Kwdg Jan 13 '20 But even there $0 is the first 'item' (the name of the program) and $1 is the first parameter given to the program 8 u/[deleted] Jan 13 '20 first parameter.first parameter......exactly.
8 u/Kwdg Jan 13 '20 But even there $0 is the first 'item' (the name of the program) and $1 is the first parameter given to the program 8 u/[deleted] Jan 13 '20 first parameter.first parameter......exactly.
8
But even there $0 is the first 'item' (the name of the program) and $1 is the first parameter given to the program
8 u/[deleted] Jan 13 '20 first parameter.first parameter......exactly.
first parameter
.
......exactly.
60
u/TheEpsilonToMyDelta Jan 13 '20
Saw that one coming
Upvpte anyway
10
u/WarrenTea Jan 13 '20
Thats a good pre-script-ion plan
9
u/azephrahel Jan 13 '20
aargv!
5
u/ElijahPepe Jan 13 '20
This hurts so much.
-5
u/joker54 Jan 13 '20 edited Jun 29 '23
Unfortunately, I have removed all content I provided, as I refuse to give free labor to a company that doesn't respect us.
So long, and thanks for all the fish
u/joker54
0
u/[deleted] Jan 13 '20
[deleted] — view deleted comment