How to get " printed on command line?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to get " printed on command line?
# 1  
Old 04-24-2015
How to get " printed on command line?

Hey,

Is there a way I can print " in a command line?
When I type "
Code:
echo "set variable = disco"

".... This actually prints
Code:
echo set variable = disco

but I would like to print it out as ---
Code:
echo "set variable = disco"

Thanks,
Satya

Last edited by Scrutinizer; 04-25-2015 at 04:06 AM.. Reason: CODE tags
# 2  
Old 04-24-2015
echo "set variable = disco" does not print the echo part on any UNIX shell.

Code:
cat <<EOF
"set variable = disco"
EOF

# 3  
Old 04-24-2015
Code:
$ printf "%s\n"  "echo \"set variable = disco\""
echo "set variable = disco"

# 4  
Old 04-25-2015
Code:
echo '"set variable = disco"'
"set variable = disco"

# 5  
Old 04-25-2015
Code:
echo 'echo "set variable = disco"'

CygWin...
Code:
AMIGA:~> echo 'echo "set variable = disco"'
echo "set variable = disco"
AMIGA:~> _

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

2. Linux

Problem with SFTP Command line, "@" in username.

Hi Guys Any help is appreciated very much! I'm trying to use SFTP to an external server using the native SFTP Client in RHEL 6 and 7. I've been given a username on the remote SFTP Server of myemail@myorg.com. I can not seem to escape that @ sign no matter what I do. I've tried these... (16 Replies)
Discussion started by: BG_JrAdmin
16 Replies

3. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies

4. Shell Programming and Scripting

Completed "Command line google translation tool"

This tool for access translate.google.com from terminal and English dictionary. main mirror https://github.com/Anoncheg1/Command-line-translator mirror Google translate from command line and some more features - Pastebin.com requirements: bash, cURL, SpiderMonkey, forvo.com account for... (0 Replies)
Discussion started by: 654321
0 Replies

5. UNIX for Dummies Questions & Answers

New to Unix command line and have a question about the "sort" command

I am going through the Unix Made Easy second edition book by John Muster. So far it's been very informative and I can tell it may be a bit out of date. In one of the exercises it talks about the "sort" command and using it to sort column's of data etc. The "sort" command has changed a bit and... (1 Reply)
Discussion started by: budfoxcat
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

append "awk command" to the end of each line

hi; this is my qqq.mos: l ./gcsw 86.0.0.1 'lt all;l+;lset SectorPort=860 Tilt 861;l-' l ./gcsw 86.0.0.2 'lt all;l+;lset SectorPort=862 Tilt 863;l-' l ./gcsw 86.0.0.3 'lt all;l+;lset SectorPort=864 Tilt 865;l-' ... i want to append;l nawk 'NR==14 && $NF!="Set."{print "l ./gcsw "r"... (4 Replies)
Discussion started by: gc_sw
4 Replies

8. UNIX for Dummies Questions & Answers

Python update already printed line.

Hi. I have a basic script in python that outputs like this.. $ ./test.py 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% ... But how can I make it so the output stays in 1 line? So it would look something like this.. $ ./test.py 10% (1 Reply)
Discussion started by: cbreiny
1 Replies

9. Shell Programming and Scripting

Need the line to be printed in single line

Hi, I have my code like this v_site_eli=`sqlplus -s<<-EOsqlplus $SQL_USERNAME/$SQL_PASSWD WHENEVER SQLERROR EXIT SQL.SQLCODE WHENEVER OSERROR EXIT FAILURE SET TERM OFF SET HEAD OFF SET VERIFY OFF SET FEEDBACK OFF declare VARIABLE vn_return_sts varchaR2(6); begin SELECT... (1 Reply)
Discussion started by: mjkreddy
1 Replies

10. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies
Login or Register to Ask a Question