script and utilities
Hi,
I have a questi' If I want to write a utlity similar to ls, etc, should I write it as script? and how in the script I can seperate th eopt that I recieved in ' - '? getops? 10x. |
Well...not really. Is there any need to create "another" ls?
If you want to learn about Linux shell scripting using Bash I suggest you download the Advanced Bash Scripting Guide. It is an excellent resource and I always keep a copy handy. Parameters passed to bash scripts can be used as $1 (for the first parameter), $2 and so on, or $* for all the parameters. $0 refers to the script itself. Håkan |
I meant that I need to write a program that will be utility as ls is.
So , I just wanted to know how utilities are writed. should I do it by script or should it involved make file etc'? 10x. |
ls is written in c, not a scripted language. if you want to learn how to script, then have a look at the bash scripting howto at tldp.org
and can we please drop the "10x"? this isn't an sms conversation. thanks. :) |
so if I want to create a program that will be as utility , I need to write it in c? in the usual way I write c programs?
what is the difference if I'll write it in script wouldn't the result will be the same, I'll be able to run both program in the command line. right? thanx :-) |
hi,
you can write simple to very sophisticated scripts. it depends on your expertise of particular language. and you can run both scripts and c programms (compiled) from command line. for more help on bash scripting read the above recommend (by hw-tph) documentation. |
Many shell utilities are themselves written in shell. There is no rule. If I remember correctly, the "time" utility is written in perl or python, I don't remember. And as said, many are in C.
Yves. |
All times are GMT -5. The time now is 11:12 PM. |