0

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

thanx for your help.. now i got it.. but i have one question when i extract data from sql script.. how can i make sure.. only data are copied and there is no garbage at the end of the file
@jack: You need to post that as a separate question with more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.