VMware Cloud Community
foster29
Contributor
Contributor

trying to execute a script

hello, i'am having some issues trying to execute a script

I have the script in /usr/ Directory named createvm.sh

I can nav to it through putty but am missing the actual command to execute it?

Reply
0 Kudos
5 Replies
esiebert7625
Immortal
Immortal

If you are in the same directory as the script you can just type "./createvm.sh" to execute it. Are you receiving an error when trying to execute it?

tlyczko
Enthusiast
Enthusiast

I have had errors with this format -- I have had to type 'bash script_name.sh'.

Reply
0 Kudos
petedr
Virtuoso
Virtuoso

Do yo have a line similar to this at the top of your script

#!/bin/bash

this tells shell what kind of script it is when you execute using ./script_name

www.thevirtualheadline.com www.liquidwarelabs.com
Reply
0 Kudos
tlyczko
Enthusiast
Enthusiast

I figured it out, I had to chmod 755 the script and I had a space after the slash, once I did these two things, I got it to work, I knew already that it was a bash script, I am having to relearn all kinds of *nix things.

Thanks, Tom

Reply
0 Kudos
petedr
Virtuoso
Virtuoso

glad you got it working now.

www.thevirtualheadline.com www.liquidwarelabs.com
Reply
0 Kudos