Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (mime attachment!) debug function: first time weird behavior



On Feb 27,  3:58pm, Timothy J Luoma wrote:
> Subject: (mime attachment!) debug function: first time weird behavior
> 
> The first time it is run it says:
> 
> /usr/local/lib/whois/ is a directory
>  whois: Have info archived: /usr/local/lib/whois/
> 
> If I run it again, it works fine.
> 
> I am totally clueless

Er, yes. :-)

        DIR=/usr/local/lib/whois 
        FILE=$DIR/$LOOKFOR 
        LOOKFOR=`echo $* | awk '{print $NF}'` 

Have you considered that perhaps you should assign a value to LOOKFORE
-before- you use it to assign to another variable?

        DIR=/usr/local/lib/whois 
        LOOKFOR=`echo $* | awk '{print $NF}'` 
        FILE=$DIR/$LOOKFOR 

Also, you could use

	LOOKFOR=$*[$#]

instead of that horrible awk.



Messages sorted by: Reverse Date, Date, Thread, Author