Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I tried to use a copied script, which includes the following command

echo "rc  $2" > $WORKDIR/out.dat

I can guess it tries to output some contents to file out.dat. But what does rc $2 mean?

It also includes

echo "PWD" >> $WORKDIR/env.txt

Why does it use >> here instead of >?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Neither of these are actually echo questions.

"rc $2" is the text "rc", a space, and the second argument passed to the script or function.

>> appends to an existing file, as opposed to > which writes to a new file, erasing any existing file in the process.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.