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
TRACE-CMD-STOP(1)														 TRACE-CMD-STOP(1)

NAME
trace-cmd-stop - stop the Ftrace Linux kernel tracer from writing to the ring buffer. SYNOPSIS
trace-cmd stop DESCRIPTION
The trace-cmd(1) stop is a complement to trace-cmd-start(1). This will disable Ftrace from writing to the ring buffer. This does not stop the overhead that the tracing may incur. Only the updating of the ring buffer is disabled, the Ftrace tracing may still be inducing overhead. After stopping the trace, the trace-cmd-extract(1) may strip out the data from the ring buffer and create a trace.dat file. The Ftrace pseudo file system may also be examined. To disable the tracing completely to remove the overhead it causes, use trace-cmd-reset(1). But after a reset is performed, the data that has been recorded is lost. SEE ALSO
trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1), trace-cmd-extract(1), trace-cmd-reset(1), trace-cmd-split(1), trace-cmd-list(1), trace-cmd-listen(1) AUTHOR
Written by Steven Rostedt, <rostedt@goodmis.org[1]> RESOURCES
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git COPYING
Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL). NOTES
1. rostedt@goodmis.org mailto:rostedt@goodmis.org 06/11/2014 TRACE-CMD-STOP(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy