Re: bash related question, adding variable into path
On Fri, 22 Jun 2012 12:34:40 +0800, Umarzuki Mochlis wrote:
> below scripts stuck when i added id variable to a path.
>
> this script supposed to copy message files (from 18-22 june) from a
> zimbra store/mailbox of a user and copied it into /tmp
>
> #!/bin/bash
> echo "Username? then [ENTER]:"
> read username
> id=`/opt/zimbra/bin/mysql -e 'use zimbra;select id,comment from mailbox;' | grep $username | cut -f 1` mkdir /tmp/$username 2>/dev/null
> for i in `egrep '(1[8-9]|2[0-2]) Jun 2012'
> /opt/zimbra/store/0/$id/msg/0/* | cut -d : -f 1 | uniq` do
> cp $i /tmp/$username
> done
>
> there must be something that i had missed...
Print/echo the $id variable to check for its current value as seen in
runtime by your script :-?
Greetings,
--
Camaleón
Reply to: