Solved

script to write file output file with double quotes

Posted on 2008-10-09
6
343 Views
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...
0
Comment
Question by:jools
  • 4
  • 2
6 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
Comment Utility
echo "alicreate \"MYALIAS\",\"00:00:00:00:00:00:00:00\""
0
 
LVL 19

Author Comment

by:jools
Comment Utility
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.

0
 
LVL 19

Author Comment

by:jools
Comment Utility
I've just typed it in verbatim and it works...

(ever had one of those days???)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
:) .. I have had my fair share
0
 
LVL 19

Author Comment

by:jools
Comment Utility
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...
0
 
LVL 19

Author Closing Comment

by:jools
Comment Utility
thanks, I thought I was really loosing it....

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

763 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

14 Experts available now in Live!

Get 1:1 Help Now