Skip to main content
edited body
Source Link
terdon
  • 252.4k
  • 69
  • 480
  • 718

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASHbash and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \> which is the same as echo foo > '>'.

So, yes, as Sirex said, that is likely a typo in your book.

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASH and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \> which is the same as echo foo > '>'.

So, yes, as Sirex said, that is likely a typo in your book.

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in bash and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \> which is the same as echo foo > '>'.

So, yes, as Sirex said, that is likely a typo in your book.

added 38 characters in body
Source Link
terdon
  • 252.4k
  • 69
  • 480
  • 718

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASH and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \> which is the same as echo foo > '>'.

So, yes, as Sirex said, that is likely a typo in your book.

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASH and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \>.

So, yes, as Sirex said, that is likely a typo in your book.

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASH and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \> which is the same as echo foo > '>'.

So, yes, as Sirex said, that is likely a typo in your book.

Source Link
terdon
  • 252.4k
  • 69
  • 480
  • 718

To append text to a file you use >>. To overwrite the data currently in that file, you use >. In general, in BASH and other shells, you escape special characters using \.

So, when you use echo foo >\> what you are saying is "redirect to a file called >", but that is because you are escaping the second >. It is equivalent to using echo foo > \>.

So, yes, as Sirex said, that is likely a typo in your book.