Sponsored Content
Top Forums Shell Programming and Scripting Building a script in Ubuntu (Linux) from existing DOS .cmd Post 302380238 by dp123 on Monday 14th of December 2009 03:29:50 PM
Old 12-14-2009
Sure (see below). Thanks for your response.
I just recreated most of it (I hadn't saved it all and deletes the last version of file)
The main problem is that the first line or two of the script works and then each one after that doesn't. But each line pasted into a terminal works fine. I just donw want to have to run it all manually each time or run a seperate script for each line!
So I just don't know how to get the script to run each line properly as an independent command.

I get errors like this:
"errors:
Creating VMs ....
Error: Invalid clone type: must be "full" or "linked"
" not found.home/administrator/vmware/Virtual Machines/VMs/England/pc1/pc1.vmx
PC 1."

Code:
 
#!/bin/bash
rmdir -p "/home/administrator/vmware/Virtual Machines/VMs/England"
mkdir "/home/administrator/vmware/Virtual Machines/VMs/England"
REM THESE FIRST 3 LINES SEEM TO WORK
echo Creating VMs ....
echo ##### PC 1
/usr/bin/vmrun -T ws clone "/home/administrator/vmware/Virtual Machines/VMs/XPVM/Windows XP Pro.vmx" "/home/administrator/vmware/Virtual Machines/VMs/England/pc1/pc1.vmx" linked
rpl "Clone of Windows XP Pro" "pc1" "/home/administrator/vmware/Virtual Machines/VMs/England/pc1/pc1.vmx"
echo 
echo PC 1 done.
REM THESE LINES DONT WORK IN THE SCRIPT BUT DO IN THE COMMAND LINE
read -p "Press any key to continue"
rem ##### PC 2
/usr/bin/vmrun -T ws clone "/home/administrator/vmware/Virtual Machines/VMs/XPVM/Windows XP Pro.vmx" "/home/administrator/vmware/Virtual Machines/VMs/England/pc2/pc2.vmx" linked
rpl "Clone of Windows XP Pro" "pc2" "/home/administrator/vmware/Virtual Machines/VMs/England/pc2/pc2.vmx"
rpl "VMnet2" "VMnet3" "/home/administrator/vmware/Virtual Machines/VMs/England/pc2/pc2.vmx"
rpl "512" "256" "/home/administrator/vmware/Virtual Machines/VMs/England/pc2/pc2.vmx"
echo 
REM THIS ONE IS UNZIPPING A VM AND THEN CREATING THE BLANK HARD DRIVE (PRE_ALLOCATED 10GB SPACE).
echo PC 2 done.
rem ##### PC 3
7z e "/home/administrator/vmware/Virtual Machines/VMs/pc3.7z" -o"/home/administrator/vmware/Virtual Machines/VMs/England/pc3/"
/usr/bin/vmware-vdiskmanager -c -s 10240MB -a lsilogic -t 2 "/home/administrator/vmware/Virtual Machines/VMs/England/pc3/pc3-000001.vmdk"
echo


Last edited by dp123; 12-14-2009 at 04:34 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

DOS Debug for linux

Hi guys. I'm in desperate need of a program that can allow me to write files to different sectors of a disk (floppy), in the same way the DOS Debug program can (with a command such as -w 100 0 0 1 to write the bootsector of the disk). Does anyone know any links or names of programs that could... (2 Replies)
Discussion started by: KrazyGuyPaul
2 Replies

2. Windows & DOS: Issues & Discussions

rediretion and pipes in DOS shell cmd interpreter

Hello, I am trying to accomplish the following. Send the output of a command to the screen (this happens by default) as well as capture the output of the screen to a log file. How can this be achieved in DOS command interpreter syntax. Any ideas/suggesstions/indicators are greatly... (2 Replies)
Discussion started by: jerardfjay
2 Replies

3. Shell Programming and Scripting

Building a Linux like LS for Unix

I'm trying to customize my environment at work in a Unix system. So I'm starting with the ls command... I'd like to make it run as the Linux ls... Even in color, if possible... My first problem is to make the file listing brake in columns... In fact, the actual ls from Unix does this, but... (3 Replies)
Discussion started by: 435 Gavea
3 Replies

4. Windows & DOS: Issues & Discussions

Awk script in DOS and Linux behaves differently :(

Hi, I have an awk script which performs simple operations of variable assignments and finally printing the variables in custom form. BEGIN {FS=OFS="\n"} { v1=substr($0,1,15) v2=substr($0,16,200) v3=substr($0,216,20) print v1 "|" v2 "|" v3 } The input file being processed... (2 Replies)
Discussion started by: vidyak
2 Replies

5. Windows & DOS: Issues & Discussions

How to connect SFTP(Linux) from Windows DOS

I need to write a batch script for file transfer from SFTP to Windows system. SFTP is on Linux system. I kept this code in batch file and executing it.. but not working.. Even i tried from Command prompt like this "open sftp.host.com" but getting error. Can anyone help with the code and tell me how... (15 Replies)
Discussion started by: mohantmk
15 Replies

6. IP Networking

Need to copy file from Linux to DOS.

I have two PCs with Ubuntu 10.4 and DOS 5.0, which are connected with a 9 pins serial cable. I need to copy some files from the Linux box to the DOS box. I tried UUCP but it's too difficult and i didn't found a working client for DOS. Can you help me? Thanks for any reply! (10 Replies)
Discussion started by: mghis
10 Replies

7. Shell Programming and Scripting

Building a DOS .bat file that will root my Droid 2 phone using adb

1. What I am doing? Building a DOS .bat file that will root my Droid 2 phone using adb commands in the .bat file. (Just for the fun of it and to help me learn "stuff".) 2. Problem: Here are the problem steps to accomplish this task manually in an adb shell: adb shell (Prompt is $) cd... (2 Replies)
Discussion started by: chrstdvd
2 Replies

8. Ubuntu

Copy existing Ubuntu to boot from USB

Hello all, I am looking for a way to copy the existing Ubuntu server 12.04 to a USB (with all the packages and such) and make it boot from the USB. I have seen other threads about copying the CD image to the USB, which is not exactly I am looking for. Before I start diving into anything I... (4 Replies)
Discussion started by: br1an
4 Replies
VMWARE-USER-SUID-WRAPPER(8)					   Open VM Tools				       VMWARE-USER-SUID-WRAPPER(8)

NAME
vmware-user-suid-wrapper - wrapper programm for vmware-user(1) SYNOPSIS
vmware-user-suid-wrapper DESCRIPTION
Operations on the vmblock(9) filesystem are considered privileged, and as such may only be issued on a file descriptor acquired by root. This is accomplished by vmware-user-suid-wrapper, a small setuid wrapper whose only purpose is to acquire a filesystem file descriptor, drop superuser privileges, and then execute vmware-user(1). In particular, prepare the system for vmware-user means that it unmounts the vmblock file system, unloads the vmblock module, then reloads the module, mounts the file system, and opens a file descriptor that vmware- user can use to add and remove blocks. OPTIONS
vmware-user-suid-wrapper has no options. SEE ALSO
vmware-checkvm(1) vmware-hgfsclient(1) vmware-toolbox(1) vmware-toolbox-cmd(1) vmware-user(1) vmware-xferlogs(1) libguestlib(3) libvmtools(3) vmware-guestd(8) vmware-hgfsmounter(8) vmblock(9) vmci(9) vmhgfs(9) vmmemctl(9) vmsock(9) vmsync(9) vmxnet(9) vmxnet3(9) HOMEPAGE
More information about vmware-user-suid-wrapper and the Open VM Tools can be found at <http://open-vm-tools.sourceforge.net/>. AUTHOR
Open VM Tools were written by VMware, Inc. <http://www.vmware.com/>. This manual page was put together from homepage materials by Daniel Baumann <daniel.baumann@progress-technologies.net>, for the Debian project (but may be used by others). 2010.03.20-243334 2010-04-08 VMWARE-USER-SUID-WRAPPER(8)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy