How create two txt in nano linux?

I would to ask if it's possible to create two txt files in one nano.

This is what i tried

enter image description here

but when I opened the the file 'os', there was only the s1.txt file. enter image description here

1 answer

  • answered 2018-01-11 21:03 JNevill

    1. Nano is a text editor. In it you write a script. Your script is called

    2. Your script writes Nothing to file s1.txt then tries three commands called one two and three which probably will just throw errors. It then writes nothing again to file s2.txt and then tries three more commands that most likely will error

    3. You exit nano, but you don't run your non-working script.

    I suspect that s1.txt already existed in your directory (not file) os.

    If you wish to write the test one two and three to a file in your script then you can use

     echo "one\ntwo\nthree" > s1.txt
     echo "four\nfive\nsix" > s2.txt

    And then run the script.