i am newbie and don't know much about bash.my instructor asked me to do cat script and observer the output and then tell What is > operator and what is the difference between > & >> operator? and i am unable to find any justifications.so,any help please :)

link|improve this question
You could fiddle with temporary files to get the difference between >> and >. – halp Nov 1 '10 at 2:18
feedback

2 Answers

The two >s append to a file.

The single > (over)writes the file.

link|improve this answer
2  
More IO redirection awesomeness: tldp.org/LDP/abs/html/io-redirection.html – Tim Bielawa Oct 31 '10 at 23:59
feedback

Unable to locate the manual page of bash? Just type man bash at the command prompt.

link|improve this answer
You could try and add come useful content to your comment. They did just have a blog post talking about RTFM style answers blog.serverfault.com/post/1306724710/rtfm Maybe you could mention that the > and >> operators are used for IO redirection tldp.org/LDP/abs/html/io-redirection.html Likewise < is used to read a file into stdin. – Tim Bielawa Oct 31 '10 at 23:59
I agree with @Tim. I'm all in favor of the "teach a man to fish" method of learning. In this case, though, and especially for a beginner, there's zero indication that output redirectors are handled by the user's shell. – ErikA Nov 1 '10 at 0:06
-1 because the bash manpage is one of the hardest to follow that I have to deal with on a regular basis. – Sparr Nov 1 '10 at 2:35
Oh come on! This is not RTFM! You can go to the manpage of bash (and I provided a link to it) press ctrl-F and type >> The first thing it shows is the usage of >> Plus, this question is homework: Do we answer homework (it was answered by andyh_ky) or do we show where the answer is? – adamo Nov 1 '10 at 6:24
How is telling him to look for "the manual page of bash" not a case of Read The F****** Manual? It's even got the word manual in it! – Sam Nov 1 '10 at 17:24
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

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