[StarCluster] Problem using StarCluster command in shell scripts

Justin Riley jtriley at MIT.EDU
Fri Jul 20 19:04:28 EDT 2012


Hi Mrinal,

My apologies for the delay on this. The following version of your script
seems to work for me:

#!/bin/sh -xv
cmd="mkdir -p /usr/local/test_lpapp"
args=""
starcluster sshmaster scsmallcluster "'$cmd $args'"

The "'$var'" trick causes single quoted strings to evaluate variables.
Test it out and let me know.

HTH

~Justin

On Sat, Jul 07, 2012 at 07:23:00PM +0530, Mrinal Zalpuri wrote:
>    Hello,
>
>
>
>    I am facing some issue when using starcluster commands from shell sripts.
>    I a shell script test.sh which has this code
>
>    *************
>
>    #!/bin/sh -xv
>
>
>
>    cmd="mkdir -p /usr/local/test_lpapp"
>
>    args=""
>
>    starcluster sshmaster scsmallcluster \'$cmd $args\'
>
>    ************
>
>
>
>    When I run this on command prompt, I am getting this error
>
>    *****************
>
>    #!/bin/sh -xv
>
>
>
>    cmd="mkdir -p /usr/local/test_lpapp"
>
>    + cmd=mkdir -p /usr/local/test_lpapp
>
>    args=""
>
>    + args=
>
>    starcluster sshmaster scsmallcluster \'$cmd $args\'
>
>    + starcluster sshmaster scsmallcluster 'mkdir -p /usr/local/test_lpapp '
>
>    StarCluster - (http://web.mit.edu/starcluster) (v. 0.93.3)
>
>    Software Tools for Academics and Researchers (STAR)
>
>    Please submit bug reports to starcluster at mit.edu
>
>
>
>    Usage: sshmaster [options] <cluster> [<remote-command>]
>
>
>
>        SSH to a cluster's master node
>
>
>
>        Example:
>
>
>
>            $ sshmaster mycluster
>
>
>
>        You can also execute commands without directly logging in:
>
>
>
>            $ starcluster sshmaster mycluster 'cat /etc/hosts'
>
>
>
>    starcluster: error: no such option: -p
>
>    ***************
>
>    But if I run starcluster sshmaster scsmallcluster 'mkdir -p
>    /usr/local/test_lpapp ' directly from the command prompt it works. Also if
>    I remove everything else and just keep this command in my script then also
>    it works. But when creating this command using arguments/variables it
>    created problem
>
>
>
>
>
>    Any help would be appreciated
>
>
>
>    best regards
>
>
>
>    Mrinal Zalpuri
>
>

> _______________________________________________
> StarCluster mailing list
> StarCluster at mit.edu
> http://mailman.mit.edu/mailman/listinfo/starcluster

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/starcluster/attachments/20120720/33963179/attachment.bin


More information about the StarCluster mailing list