shell scripts and comand arguments

Frank Shute frank at esperance-linux.co.uk
Tue Jun 3 19:57:34 BST 2003


On Tue, Jun 03, 2003 at 04:08:34PM +0100, Lou Kamenov wrote:
>
> In some email I received from "Frank Shute"
> <frank at esperance-linux.co.uk> on Mon, 2 Jun 
> 2003 17:14:16 +0100, wrote:
> 
> > On Mon, Jun 02, 2003 at 10:57:02AM +0100, Jonathan Belson wrote:
> > >
> > > On Monday 02 June 2003 10:15 am, Frank Shute wrote:
> > > > On Mon, Jun 02, 2003 at 09:07:32AM +0100, John Rochester wrote:
> > > > > You need sh to pass this through another parsing stage to catch the
> > > > > quotes.
> > > > >
> > > > > Change the final line to
> > > > >
> > > > >     eval mhonarc "$args"
> > > > >
> > > > > and it should work.
> 
> eval is a pretty useful thing 
> it works really well in thigs like
> 
> foo=(foo1 foo2 foo3)
> funct(){
> 	eval eval myarr=(\${${1}[@]})
> 	....
> 	....
> }
> 
> funct foo
> 
> anyway there's a plenty of 'eval' examples and good scripting in the
> FreeBSD rc system. 

`eval' isn't something I've ever used before. I'll have to muck around
with it sometime & have a closer look at the rc system.

> 
> sometimes i think bash is so much more powerful then csh even tcsh

I've been posting to cubfm about what a stinky shell bash is :{
I have to say I like pdksh for everyday use and my own scripts. You
can do stuff like this with it:

if [[ $1 = @(-w|-t|-thmbw|-thmbt) ]] && [[ $2 = *.jpg ]] && [[ $3 = *.jpg ]];
....

I don't think bash supports regexs to the same extent.

> 
> even things like /dev/tcp/host/port  :))
> 
> anyway it's still obsolete for real programming ;-D

I never write `real programs'.....if I can't do it with shell or perl,
or it's > 100 lines I grovel through the ports or on the 'net!

> sometimes ago I found Bash OOP, no kidding! 

With a bit of luck it will kill off C# ;)

> 
> 
> cheers,

Regards,

-- 

 Frank 

*-*-*-*-*-*-*-*-*-*-*
   Boroughbridge.
 Tel: 01423 323019
     ---------
PGP keyID: 0xC0B341A3
*-*-*-*-*-*-*-*-*-*-*

http://www.esperance-linux.co.uk/

Those WMD in perspective:

   "The 1995 nerve agent attack in Tokyo was carried out by a group of
   20 or 30 people, some with scientific training and access to a
   well-equipped lab. They killed 12 people.  

   Last week, a single lunatic with a bottle of gasoline (petrol)
   killed 133 on a Korean subway."

   http://www.kuro5hin.org/story/2003/2/24/21408/4742




More information about the Ukfreebsd mailing list