早教吧作业答案频道 -->其他-->
这个shell脚本中的函数什么意思?完全看不懂啊usage(){cat&2$0:[options][src]dst-v:outputactionsperformed.-eenv-var:onlytakeactionifenv-varissetto"y".-ooption:onlytakeactionifoptionissetto"y".-pperms:chmodsty
题目详情
这个shell脚本中的函数什么意思?完全看不懂啊
usage()
{
cat &2
$0:[options] [src] dst
-v :output actions performed.
-e env-var :only take action if env-var is set to "y".
-o option :only take action if option is set to "y".
-p perms :chmod style permissions for dst.
-d :make dst directory if it doesn't exist
-S :don't strip after installing
-a text :append text to dst.
-A pattern :only append text if pattern doesn't exist in file
-l link :dst is a link to 'link'.
-s sym-link :dst is a sym-link to 'sym-link'.
if "src" is not provided,basename is run on dst to determine the
source in the current directory.
multiple -e and -o options are ANDed together.To achieve an OR affect
use a single -e/-o with 1 or more y/n/"" chars in the condition.
if src is a directory,everything in it is copied recursively to dst
with special files removed (currently CVS and Subversion dirs).
EOF
exit 1
}
usage()
{
cat &2
$0:[options] [src] dst
-v :output actions performed.
-e env-var :only take action if env-var is set to "y".
-o option :only take action if option is set to "y".
-p perms :chmod style permissions for dst.
-d :make dst directory if it doesn't exist
-S :don't strip after installing
-a text :append text to dst.
-A pattern :only append text if pattern doesn't exist in file
-l link :dst is a link to 'link'.
-s sym-link :dst is a sym-link to 'sym-link'.
if "src" is not provided,basename is run on dst to determine the
source in the current directory.
multiple -e and -o options are ANDed together.To achieve an OR affect
use a single -e/-o with 1 or more y/n/"" chars in the condition.
if src is a directory,everything in it is copied recursively to dst
with special files removed (currently CVS and Subversion dirs).
EOF
exit 1
}
▼优质解答
答案和解析
这个函数里面用到Here Documents,主要功能是将两个!EOF标签中间的内容cat 重定向到STDERR标准错误输出里面.
>&2 就是 重定向到STDERR标准错误输出 的意思.
>&2 就是 重定向到STDERR标准错误输出 的意思.
看了 这个shell脚本中的函数什...的网友还看了以下:
ΔH-TΔS如果小于0,则反应可自发进行.如果有一个反应ΔH=-100,ΔS=-200则这个反应可以 2020-03-30 …
已知线段a,(h小于a,h小于b),求作一个三角形,使其两边分别等于AB,第三边的高=h,h=1c 2020-05-13 …
如图,一扇窗是由一个半径为r的半圆和一个宽为h的长方形组成.(1)用含r和h的代数式表示整扇窗的面 2020-05-13 …
盐酸和硫酸的PH比较0.1mol/L盐酸溶液和0.1mol/L硫酸溶液,哪个的c(H﹢)大,即哪个 2020-05-15 …
动物细胞的线粒体DNA分子通常呈环状双链,即H链和L链.H链上有两个复制起始区,一个用于H链合成( 2020-05-16 …
在下面的空白方格中填入适当的字母,是每一横行构成一个单词.h()()()()()h()()()() 2020-05-16 …
如何求化合物中各元素的质量比计算H O两种元素的质量比1.查处H O两种元素的质量 H:1 O:1 2020-05-16 …
同一个C上连有2个甲基与2个H.请问这个物质有几个等效H 2020-06-04 …
浮力的几个公式分别什么时候用?浮力公式好多,字母也多,1.F浮=F向上-F向下2.F向上-F向下= 2020-06-08 …
我的山地车是18速的,右把是数字,左把有两个大写字母,一个是H,一个是L.H是heavy(沉的), 2020-06-09 …