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???)
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert grep lines to perl 6 40
Linux Copy Command - All Files inc Directory 1 42
Setting up static IP - Ubuntu server 16.04 12 64
parse a file and get data out 11 46
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

810 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