The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
easy question tonet UNIX for Dummies Questions & Answers 15 10-19-2007 11:08 AM
Need help on installing an EASY to use and easy to install command line text editor EugeneG UNIX for Dummies Questions & Answers 4 07-16-2007 12:53 PM
Trouble with Backslashes wibo1 Shell Programming and Scripting 0 09-15-2006 05:22 AM
Easy script guest100 UNIX for Dummies Questions & Answers 8 03-07-2005 10:57 AM
Easy one vcardo10 UNIX for Dummies Questions & Answers 11 04-20-2004 12:13 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-08-2006
sun-guy sun-guy is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 3
Talking How to echo 4 backslashes more easy ?

How to echo 4 backslashes more easy ? I can use 16 to echo 4 backslashes.

# echo \\
\
# echo \\\\
\
# echo \\\\\\
\\
# echo \\\\\\\\
\\
# echo \\\\\\\\\\
\\\
# echo \\\\\\\\\\\\
\\\
# echo \\\\\\\\\\\\\\
\\\\
  #2 (permalink)  
Old 08-08-2006
Mars8082686 Mars8082686 is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 5
try it with single quotes... like this
Code:
echo '\\\\'
(this seems to work in bash.... haven't tested it in other shells)

cheers
  #3 (permalink)  
Old 08-08-2006
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
I just spent 10 minutes of my life trying to figure it out in ksh
Code:
# print -R '\\\\'
  #4 (permalink)  
Old 08-08-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,957
either of the option would do,

print -r '\\\\'
or
print -R '\\\\'
  #5 (permalink)  
Old 08-08-2006
mukundranjan mukundranjan is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 20
Hi sun Guy,

How u got 4 slashes only when u type

Code:
echo \\\\\\\\\\\\\\    -- 14 
it will output \\\\\\\ -- 7
it always give half no of output other half is used as escape..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0