The teacher never explained us anything about unix and bash. He told us something about the history. Then he said how to fill in an IP address in a program called putty, which is the shell we used to work on the server. He basically gave us 7 series of exercises. We also had a book that was pretty useless. I mostly used internet and SO to help myself out, along with the commands I knew from DOS and the man/info pages.
The question is, what is the preferred text editor to make scripts? Internet says any will do but I know only cat. And then, how do I even begin? What I need is a crash course or something. I’m sorry I know this isn’t the best kind of question to ask here but it’s all I can think of atm. Don’t blame me, but please do bash the teacher (pun intended).
Try using
vias your text editor. Change to the directory you want your script to be saved in and then type in `vi myScript.sh”. This will start the vi text editor. You can type in all your shell commands here.Here’s a link to a vi cheat sheet – http://linuxfordummies.org/tag/vi/
Once your in vi, you can type in one command on each line, you can use enter to move to the next line. After you have your script typed in, press : on the keyboard to open a prompt for vi. Once you have the : (colon) prompt at the bottom of the screen, enter
wqfor write/quit. This will save myScript.sh to the directory you started in. You should then be able to execute the script just by callingmyScript.shI hope this helps, best of luck!