script to write file output file with double quotes

Posted on 2008-10-09
Last Modified: 2013-12-26
OK, I'm having a bit of a problem concentrating on work today... Holiday in 2 days!!! :-)

I need to write a script that produces this output;

     alicreate "MYALIAS","00:00:00:00:00:00:00:00"

The script is done apart from actually producing the output in the correct format... or... as is more commonly known... all done except for the important bit!

The problem is with the flippin double quotes! I've dont this before a long time ago but cant find an example of it and cant seem to google the right response.

I need a response quickly so I've given it top points.

BTW, I've tried various combinations of single and double quotes, escaping chars etc but my brain has now shut down...
Question by:jools
  • 4
  • 2
LVL 45

Accepted Solution

sunnycoder earned 500 total points
ID: 22679001
echo "alicreate \"MYALIAS\",\"00:00:00:00:00:00:00:00\""
LVL 19

Author Comment

ID: 22679066
ok, rather strangely, I get this;
   "licreate "SUN027_A","20:00:00:e0:8b:80:f9:5b

which kinda reminds me of one of my previous attempts.

I wonder if there is some sort of dodgy char in there somewhere.

LVL 19

Author Comment

ID: 22679094
I've just typed it in verbatim and it works...

(ever had one of those days???)
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

LVL 45

Expert Comment

ID: 22679167
:) .. I have had my fair share
LVL 19

Author Comment

ID: 22679173
OK... Well I've finished the script and it looks like there was garbage on the input file.

$ cat -etv SWITCH-ALIASES.txt
alicreate "SUN008_A","20:00:00:e0:8b:82:36:8e"$
alicreate "SUN027_A","20:00:00:e0:8b:80:f9:5b^M"$

Thanks for the sanity check Sunny...
LVL 19

Author Closing Comment

ID: 31504671
thanks, I thought I was really loosing it....


Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Recently, an awarded photographer, Selina De Maeyer (, completed a photo shoot of a beautiful event ( in An…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now