StarCluster - Mailing List Archive

Re: Problem using StarCluster command in shell scripts

From: Justin Riley <no email>
Date: Fri, 20 Jul 2012 19:04:28 -0400

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




  • application/pgp-signature attachment: stored
Received on Fri Jul 20 2012 - 19:04:40 EDT
This archive was generated by hypermail 2.3.0.

Search:

Sort all by:

Date

Month

Thread

Author

Subject