How do I make a text file in Bash?
All I want to do is write a script that makes a text file called "test" containing the text:
Code:
Hello World! I know it can be done easily... but I don't know how. :newbie: |
Solved. Thanks to Google, I remembered something very basic I had forgotten:
Code:
>> Code:
echo -e "Hello World!\nThis is my stupid text file." >> /foo/bar/test |
There is also another way that works better especially if you need to add lots of lines of text, you can use the cat commad and run it through a script.
Code:
#!/bin/sh Code:
#!/bin/sh |
All times are GMT -5. The time now is 04:38 PM. |