Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Should be easy but want to know why the “left arrow” < is used instead of right arrow.

   done < a.txt

What does it mean by left arrow? I thought since I am done with the condition, the output should be saved in a.txt with right arrow like done > a.txt

Why we use left arrow for if-statement?

share|improve this question
up vote 7 down vote accepted

arrows are for redirection: > redirects an output file-descriptor, < an input file-descriptor.

since you are asking a lot of questions that are all related, you really should have a look at the manpage of bash. Try:

man bash

it's available online and there' also a good documentation.

share|improve this answer
I'd also recommend the Advanced Bash-Scripting Guide for learning bash. If you feel that it progresses too rapidly, the Bash Guide for Beginners might also be useful. – Thomas Nyman Oct 9 '13 at 8:29
@ThomasNyman The infamous "Advanced" Bash Scripting Guide should be avoided unless you know how to filter out the junk. It will teach you to write bugs, not scripts. In that light, the BashGuide was written: mywiki.wooledge.org/BashGuide – Chris Down Oct 9 '13 at 8:56

Your Answer


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.