The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
can anyone help with shell script command about searching word with grep command? aintour Shell Programming and Scripting 2 10-14-2009 05:51 PM
problem with output of find command being input to basename command... new_learner UNIX for Dummies Questions & Answers 2 12-14-2008 02:56 AM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 01:29 PM
assign a command line argument and a unix command to awk variables sweta_doshi Shell Programming and Scripting 0 08-08-2008 07:54 AM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 09:26 AM

Reply
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 10-16-2009
shweta_babbar shweta_babbar is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
Cut command


Code:
$ cut -d\| -f 2,3 shortlist | tee cutlist1

what's the use of \ in this command??

Last edited by radoulov; 10-16-2009 at 07:55 AM.. Reason: please use code tags
  #2 (permalink)  
Old 10-16-2009
dr.house dr.house is offline
Registered User
  
 

Join Date: Dec 2008
Location: Switzerland
Posts: 229
I daresay this means that the pipe following ought to be used not as pipe but as delimiter, or, how I would code it:


Code:
cut -d '|' -f 2,3 shortlist | tee cutlist1

  #3 (permalink)  
Old 10-23-2009
douglas.pavey douglas.pavey is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
The full explaination is that the \ acts as an escape, which turns off shell translation of the next character, so, in your example, | isn't handled by the shell as the pipe, but as a character. Putting single quotes around it is a bit more straightforward and lends more to readability by humans, as the previous poster, "DR House" recommended.
Reply

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 03:54 AM.


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