Posts: 4
Threads: 1
Joined: Aug 2011
Reputation:
0
Can anyone point me in the right direction for a good bash primer? I like to use terminal (call me crazy, maybe?) because I don't have to worry about give the file management system escalated permissions and I really loathe using a mouse unless I have to. Coming from Windows I had most of my DOS commands down but still have trouble with syntax and switches etc..
Any help would be appreciated.
Posts: 955
Threads: 36
Joined: Sep 2008
Reputation:
0
There's a pile of system scripts in /etc/init.d - it's worth sneaking a look at a few there and try to puzzle out what they're doing.
A number of things to point out before you start writing your own scripts:
<ol style="list-style-type: decimal">
[*]your scripts need to have EXECUTE permission on (chmod u+x myscript) in order to run
[*]your scripts need to be in a directory mentioned in your ${PATH} variable to run them by name alone. Your "bin" dir inside your own home directory is a common place to put them.
[*]use the "which" command to see if that script name (or command name) is already taken, eg: "which date" or "which mydate".
[*]Don't call your scripts "script" or "test". It's a common mistake, but they're reserved words.
[*]Some people like to append a file extension, such as ".sh" to their script names. Unlike windows, the actual filename isn't important, but don't forget to use its full name ("autoexec.sh", not just "autoexec")
[*]Minor point, but sometimes writing and saving (without quitting) in one window then running in another window means you can quickly compare code and results side-by-side.
[*]If you dislike vi, consider installing "nano" or "pico" as alternative editors
[*]If you already know all that stuff above... well, let's move onto lesson 2!
</ol>
Good luck!
Posts: 955
Threads: 36
Joined: Sep 2008
Reputation:
0
Oh, and one last bit: feel free to post examples of your non-working code in here. We can give you pointers as to why it doesn't work, as well as alternative ways of writing the same script.
(well, Hybrid can, because he's tha King Kodah here. I'm just a serf)
Posts: 995
Threads: 128
Joined: Jul 2005
Reputation:
0
<div><iframe width="480" height="270" src="https://www.youtube.com/embed/i16cQTULEjM?feature=oembed" frameborder="0" allowfullscreen="true"></iframe></div>
<div><iframe width="480" height="270" src="https://www.youtube.com/embed/KRs-rEx-EJA?feature=oembed" frameborder="0" allowfullscreen="true"></iframe></div>