5

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

   if
   fi
   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?

7

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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