Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

What I'm Trying To Accomplish:

  • Get list of Virtual Machines ".vmx" file and place in variables
  • Give the user and choice of which VM to backup
  • Use "ovftool" to produce an export of the chosen VM to a hardcoded location

What I Have So Far:

#!/bin/bash

# MyVariables
#vmFolder=
#vmList=
#vmDestination="~/Desktop/"
vmTool="/Applications/VMware OVF Tool/ovftool"

# DatScript
for i in "/Users/$USER/Documents/Virtual Machines.localized/"* ; do
   if [ -d "$i" ]; then
     echo $(basename "$i")
   fi
done

Still getting used to Bash and FWIW I'm writing this for OS X 10.8 but thought the Unix SE would be best.

share|improve this question
    
@Anthon it says you edited my post but I don't see anything different? And is this post in the correct spot? –  BsdHelper Nov 30 '13 at 16:17
1  
You can click on the link 'edited X hours ago' above the last editors (my) image to the left of yours. You will see the edit history. There should be people here who can help you out with bash scripts, although I would do such a thing in a Python program. So yes it should be ok here. –  Anthon Nov 30 '13 at 17:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.