Re: bash related question, adding variable into path

2012-06-23 Thread rjc
On Fri, Jun 22, 2012 at 05:34:40AM BST, 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]

Re: bash related question, adding variable into path

2012-06-23 Thread Camaleón
On Sat, 23 Jun 2012 12:14:39 +0800, Umarzuki Mochlis wrote: > 2012/6/22 Camaleón : >> On Fri, 22 Jun 2012 12:34:40 +0800, Umarzuki Mochlis wrote: > >>> #!/bin/bash >>> echo "Username? then [ENTER]:" >>> read username >>> id=`/opt/zimbra/bin/mysql -e 'use zimbra;select id,comment from mailbox;' |

Re: bash related question, adding variable into path

2012-06-23 Thread Umarzuki Mochlis
2012/6/23 Keith McKenzie : > I think maybe put ; after the first command before issuing the second > command mkdir > > id=`/opt/zimbra/bin/mysql -e 'use zimbra;select id,comment from > mailbox;' | grep $username | cut -f 1` ; mkdir /tmp/$username > 2>/dev/null > > &/or, possibly you need to escape

Re: bash related question, adding variable into path

2012-06-23 Thread Keith McKenzie
I think maybe put ; after the first command before issuing the second command mkdir id=`/opt/zimbra/bin/mysql -e 'use zimbra;select id,comment from mailbox;' | grep $username | cut -f 1` ; mkdir /tmp/$username 2>/dev/null &/or, possibly you need to escape your statement id=`/opt/zimbra/bin/mysql

Re: bash related question, adding variable into path

2012-06-22 Thread Umarzuki Mochlis
2012/6/22 Camaleón : > On Fri, 22 Jun 2012 12:34:40 +0800, Umarzuki Mochlis wrote: >> #!/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

Re: bash related question, adding variable into path

2012-06-22 Thread Camaleón
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]:"

bash related question, adding variable into path

2012-06-21 Thread Umarzuki Mochlis
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 fr