开发者

c shell script explain

I am completely new to scripting. Can someone please explain to me what's going on here? Thank you.

开发者_开发技巧echo 'Report 1' > ${TMP}/reports.tmp
uuencode ${DATA}/${ext1} ${ext1} >> ${TMP}/reports.tmp


TMP, DATA and ext1 are variables whose content can be accessed by $TMP, $DATA and $ext1 or ${TMP}, ${DATA} and ${ext1}

echo is a command to print a string to standard output

uuencode is a program to encode a binary file into an ASCII representation (might be e.g. needed to transfer the content of a binary file via mail)

> means redirection of standard output into a file (overwriting the file)

>> means redirection of standard output into a file (appending to that file)

echo 'Report 1' > ${TMP}/reports.tmp creates the file reports.tmp in a directory specified by variable TMP and writes the string "Report 1" into it

uuencode ${DATA}/${ext1} ${ext1} >> ${TMP}/reports.tmp appends the uuencoded version of the file ${DATA}/${ext1} (i.e. directory specified by variable DATA, filename specified by ext1) to reports.tmp

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜