
Introduction
Hey Everyone, Good to see you back! For us programmers, diving into the world of Bash scripting is really important. It's a...
For further actions, you may consider blocking this person and/or reporting abuse
@harshit_rwt there is an error in the
firstscript.sh
file, It will not create 5 files (at least for me) instead it will create only 1 file with the namefile_{1..5}.txt
.The below code works fine:
Nice article and good reading.
Hi @rajeshroyal,
Thanks for your feedback! I appreciate the suggestion. The approach I used {1..5} does create five separate files in Bash, since it expands before execution, generating unique filenames (file_1.txt, file_2.txt, etc.).
I see why you might be getting file_{1..5}.txt , this can happen if the script is run in sh instead of bash, as sh doesnβt support {1..5} expansion. Your (seq 1 5) approach is a great alternative for broader shell compatibility, though {1..5} is slightly more efficient in pure Bash.
Really appreciate the discussion, always great to learn different approaches! π
Thanks @harshit_rwt
"This is what i am looking for π₯π₯"
Very informative
This is a great tutorial on bash script.
Thank you
Thankyou for such a positive feedback,
Glad you liked it!
Nice
Informative, Thank you.
Great tutorial on bash scripting. Thanks
Such a great article, so thorough and detailed. Thanks for this, Great π work indeed.
Thank you for your kind words! Really happy that you enjoyed it. Your appreciation means a lot! β¨
Because it's basics, I think you need to mention how to save and exit the vim after entering the content. Like :wq at the beginning.