Your system clock seems to be broken.

On Sun, Aug 14, 2005 at 02:22:28PM +0600, ???????????? ?????????? wrote:
> i've made some script for management my mpc:
> 
> #!/bin/sh
> st=$1
> isdir="0";
> IFS=$'\n'
> st=`mpc ls $1 | wmiimenu`

Why do you set st=$1 and then you overwrite its value?
I also don't see a reason why manipulating IFS is necessary.

> for name in `ls "/data/music/$st"` ; do
> #    IFS=$' \t\n'
>    if [ -d "/data/music/$name" ] ; then

This looks wrong, did you mean /data/music/$st/$name?

>        isdir="1"
>    fi
> #    IFS=$'\n'
> done
> #set IFS=$' \t\n'
> if [ "$isdir" != "1" ]; then
>    ./mpccont.sh "$st";
> else
>    mpc clear
>    mpc add "$st"
>    mpc play;
> fi

I don't understand why you iterate over all files in the dir
/data/music/$st to set isdir (it will always point to the last
entry) and then deciding what todo.

#!/bin/sh
song=`mpc ls $1 | wmiimenu`
if test -d "/data/music/$song"
then
        :
else
        mpc clear
        mpc add "$song"
        mpc play
fi

Dunno if that is what you want todo...

Regards,
-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361

_______________________________________________
wmii@wmii.de mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii

Reply via email to