当前位置: 技术问答>linux和unix
下面是CenterOS中,/etc/init.d/httpd文件中的内容,不解其意,请高人解释
来源: 互联网 发布时间:2016-10-06
本文导语: 下面是CenterOS中,/etc/init.d/httpd文件中的内容,不解其意,请高人解释: httpd=${HTTPD-/usr/sbin/httpd} prog=httpd echo -n $"Starting $prog: " | httpd=${HTTPD-/usr/sbin/httpd} 如果变量HTTPD定义了且不为空 那么...
下面是CenterOS中,/etc/init.d/httpd文件中的内容,不解其意,请高人解释:
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
echo -n $"Starting $prog: "
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
echo -n $"Starting $prog: "
|
httpd=${HTTPD-/usr/sbin/httpd}
如果变量HTTPD定义了且不为空 那么就把变量HTTPD值赋给变量httpd
否则 把/usr/sbin/httpd赋给变量httpd
如果变量HTTPD定义了且不为空 那么就把变量HTTPD值赋给变量httpd
否则 把/usr/sbin/httpd赋给变量httpd
|
Modifier
Value
${variable:–word}
If variable is set and is non-null, substitute its value; otherwise, substitute word.
${variable:=word}
If variable is set or is non-null, substitute its value; otherwise, set it to word. The value of variable is substituted permanently. Positional parameters may not be assigned in this way.
${variable:+word}
If variable is set and is non-null, substitute word; otherwise, substitute nothing.
${variable:?word}
If variable is set and is non-null, substitute its value; otherwise, print word and exit from the shell. If word is omitted, the message parameter null or not set is printed.
${variable:offset}
Gets the substring of the value in variable starting at offset, where offset starts at 0 to the end of the string.[a]
${variable:offset:length}
Gets the substring of the value in variable starting at offset, length characters over.
Value
${variable:–word}
If variable is set and is non-null, substitute its value; otherwise, substitute word.
${variable:=word}
If variable is set or is non-null, substitute its value; otherwise, set it to word. The value of variable is substituted permanently. Positional parameters may not be assigned in this way.
${variable:+word}
If variable is set and is non-null, substitute word; otherwise, substitute nothing.
${variable:?word}
If variable is set and is non-null, substitute its value; otherwise, print word and exit from the shell. If word is omitted, the message parameter null or not set is printed.
${variable:offset}
Gets the substring of the value in variable starting at offset, where offset starts at 0 to the end of the string.[a]
${variable:offset:length}
Gets the substring of the value in variable starting at offset, length characters over.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。