Re: help, help scripting masters

From: <captgoodnight@acsalaska.net>
Date: Mon Mar 22 2004 - 23:01:07 AKST

On Monday 22 March 2004 10:32 pm, Arthur Corliss wrote:

> What version of shell are you using?
GNU bash, version 2.05b.0(1)-release-(i586-mandrake-linux-gnu)

> This exact example that you gave works just fine for me.
Wont take spaces here. I swear! |:p(

> Though I do have to wonder why you would execute a
> system() call to assign $2 to FOLDER, when FOLDER=$2 would work the same
> (and without the subshell).

Good question. ? I may have hit my head sometime that day.?

> 2) Every strange corner case that you can't get to work

I think I understand now.

> Your code above should work in most circumstances, particularly those with
> whitespace. If it doesn't it's got to be a problem with the interpreter
> itself.
>
> Check out this sample session:
>
> acorliss@bifrost:~/test$ cat test.sh
> #!/bin/sh
>
> workem_ ()
> {
> ls "$FOLDER"
> }
>
> case $1 in
> --folder|-f)
> FOLDER=`echo $2`
> workem_;;
> *) exit;;
> esac
>
> acorliss@bifrost:~/test$ mkdir "foo bar" foo
> acorliss@bifrost:~/test$ touch foo\ bar/got-it foo/no-go
> acorliss@bifrost:~/test$ ./test.sh -f foo\ bar
> got-it
> acorliss@bifrost:~/test$ ./test.sh -f "foo bar"
> got-it
> acorliss@bifrost:~/test$ ./test.sh -f foo
> no-go
>
> My sh is just a symlink to /bin/bash in this case, though.
>
> --Arthur Corliss
> Bolverk's Lair -- http://arthur.corlissfamily.org/
> Digital Mages -- http://www.digitalmages.com/
> "Live Free or Die, the Only Way to Live" -- NH State Motto

>If, for whatever reason, his shell actually does act in the way that you're
>describing above I would have to suggest that it's a bug in the shell, and
>should be reported.

I have been thinking it's a bug for a few days now. Sometimes it (spaces) worked, others not. Also, just last night my
delete key gives me a ~ now, instead of munching away. ? Is that normal from some change?

thanks,

eddie

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Mar 22 23:01:15 2004

This archive was generated by hypermail 2.1.8 : Mon Mar 22 2004 - 23:01:15 AKST