Lang for OS interaction

So...
Time has come, for me, to put some automated tasks in a script, in order to more efficiently control and interact generally with my OS -> THE FreeBSD

sh, csh, tcsh, or PHP (in which I code web applications, for very long and know it upside down and do it with OO approach and generally it is in my finger).

root is by default bestowed by csh shell and recommended to switch to tcsh.
Then again, why all /etc/rc.d scripts are written in sh shell language and not in "superior" [t]csh shell?

Hell, should I just skip learning and stick to what I know and do all with PHP?

PS: What extension of files do you recommend for PHP CLI scripts?
 
[t]csh is not is not superior, in fact it's inferior....
they are root shell by default because.... try using sh for few days, and you'll see.

I'd love to see mksh or something of msh family as default shell

Learning sh will give you many advantages with many common problems
 
I much prefer Bourne shell for system scripts, but in certain instances it can just be too slow for certain tasks. My advice is stick to Bourne as much as possible, but use PHP or Python where Bourne is inappropriate.
 
My advice is never use brourne shell xD Use sh and perl for system scripts. For really close system work - C.
 
This might get confusing very quickly. Seeker, you're posting this in "Userland Programming & Scripting", yet your topic is "Lang for OS interaction".

Is your question about scripting or interacting? As far as shells (in the strict sense) are concerned: for shell scripting, most people will advise you to stick with 'sh'. For shell interaction, most people will tell you not to use 'sh'.

I don't really know what "Lang(uage) for OS interaction" is .. did you mean "Language for scripting"? Then you can look at perl, python, etc. etc.
 
I see..., so tcsh and csh, are intended to ease human, with interacting with OS.

And sh is for scripting automated task as is "stable" and well tested.
How complex is sh anyway. Closer to JavaScript or PHP ( LOL! web dev :p )

DutchDaemon said:
This might get confusing very quickly. Seeker, you're posting this in "Userland Programming & Scripting", yet your topic is "Lang for OS interaction".

Is your question about scripting or interacting? As far as shells (in the strict sense) are concerned: for shell scripting, most people will advise you to stick with 'sh'. For shell interaction, most people will tell you not to use 'sh'.

I don't really know what "Lang(uage) for OS interaction" is .. did you mean "Language for scripting"? Then you can look at perl, python, etc. etc.

Duh! You have now totally confused me.
Scripting..., which is automation of task of this type

How do you define shell interaction, anyway?! I would say I interact wit shell by mouse and keyboard.
So when I do scripting, then that script interacts with shell thus doing some automated tasks to OS

So I guess it would be / mean:
Lang for writing scripts that will do OS interaction
 
Seeker said:
How complex is sh anyway. Closer to JavaScript or PHP ( LOL! web dev :p )
Pretty simple, just weird. A lot of operations are just programs executing and the interpreter responding to exit codes. The more you use it the more you begin to "get it", so get started. ;)

I'd say it's nothing like PHP or JavaScript.
 
aragon said:
...
I'd say it's nothing like PHP or JavaScript.
Of course it's nothing like PHP or JavaScript.
I wanted reference to complexity.
PHP is far more complex then JavaScript.
So is sh complex like JS or PHP?

Can I/should do all that in PHP, instead "wasting time" learning sh? :stud
 
Seeker said:
Of course it's nothing like PHP or JavaScript.
I wanted reference to complexity.
PHP is far more complex then JavaScript.
So is sh complex like JS or PHP?
It's a very simple language compared to both of those. Then again, I think JavaScript is more complex than PHP, so who knows what you'll think of Bourne. :) Try it.


Seeker said:
Can I/should do all that in PHP, instead "wasting time" learning sh? :stud
All FreeBSD userland scripts are written in Bourne. It will never be a waste learning it.
 
You think wrong... PHP is more complex then JavaScript.

Ok guys, just spit out a best sh related book.
 
I find that I need to use bash for some scripts, just because of the ability to direct STDOUT and STDERR to different places; bash has the mechanism with 1> and 2> I tend to lean toward perl whenever I need to do something, but that's probably because I'm very comfortable with it and have used it extensively the past couple years writing applications with a web front-end.
 
Seeker said:
Date: 6 Oct 1996 14:03:18 GMT

Come on. That info is very old.
All shells have been improved, over last 14 years :p

Not on the most basic stuff. The new versions of these shells still need to be able to run 15 year old code :p
 
It is not as there is no direct comparision of features, BUT comparision of amount of syntax to learn (ie: complexity)
 
Back
Top