Shell script reception parameters

test.sh

#!/bin/bash

echo
"Script name$0"
echo
"The first parameter $1"
echo
"The second parameter $2"
echo
"The third parameter $3"
echo
"The fourth parameter $4"
echo
"The fifth parameter $5"
echo
"The sixth parameter $6"
echo
"The seventh parameter $7"
echo
"The eighth parameter $8"
echo
"The ninth parameter $9"
echo
"The tenth parameter ${10} "
echo
"The 11th parameter ${11} "

Output

bogon:Desktop macname$. /test.sh abcdefghijk

Script name.
/test.sh
The first parameter a
The second parameter b
The third parameter c
The fourth parameter d
The fifth parameter e
The sixth parameter f
The seventh parameter g
The eighth parameter h
The ninth parameter i
The tenth parameter j
The eleventh parameter k

Reference:

https:/ /blog.csdn.net/sinat_36521655/article/details/79296181

#!/bin/bash

echo
"Script name$0"
echo
"The first parameter $1"
echo
"The second parameter $2"
echo
"The third parameter $3"
echo
"The fourth parameter $4"
echo
"The fifth parameter $5"
echo
"The sixth parameter $6"
echo
"The seventh parameter $7"
echo
"The eighth parameter $8"
echo
"The ninth parameter $9"
echo
"The tenth parameter ${10} "
echo
"The 11th parameter ${11} "

bogon:Desktop macname$ ./ test.sh abcdefghijk

Script name.
/test.sh
The first parameter a
The second parameter b
The third parameter c
The fourth parameter d
The fifth parameter e
The sixth parameter f
The seventh parameter g
The eighth parameter h
The ninth parameter i
The tenth parameter j
The 11th parameter k

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5504 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.