The UNIX and Linux Forums  


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



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

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 12-14-2009
abacus's Avatar
Registered User
 

Join Date: Oct 2009
Location: 41.332032,-73.089775
Posts: 27
@franklin52

Thanks for the explanation. However for someone learning scripting in general. Where would that information be published? I checked the man pages on OSX and RHEL for "cut". I do not see that type of information?

Regards,

Abacus




SORRY:
MAN CUT
Numbers or number ranges may be followed by a dash, which selects all fields or columns from the last number to the end of the line.

Last edited by abacus; 12-14-2009 at 11:04 AM.. Reason: USED MAN PAGE
  #9 (permalink)  
Old 12-14-2009
Registered User
 

Join Date: Jun 2006
Posts: 468
Quote:
Originally Posted by abacus View Post
@rcdwayx,


I have checked man cut and have not located what you have done with the trailing dash after f2. Could you please elaborate on this? Or point me to the doc that contains this type of switch.


Code:
$ echo "My Name is Ashish" |cut -d" " -f2-


Regards,

Abacus

Code:
       Use one, and only one of -b, -c or -f.  Each LIST is made up of one range, or many ranges separated  by  com-
       mas.   Selected  input is written in the same order that it is read, and is written exactly once.  Each range
       is one of:

       N      N'th byte, character or field, counted from 1

       N-     from N'th byte, character or field, to end of line

       N-M    from N'th to M'th (included) byte, character or field

       -M     from first to M'th (included) byte, character or field

       With no FILE, or when FILE is -, read standard input.

Sponsored Links
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 Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
reading in arguments with spaces Calypso Shell Programming and Scripting 11 04-23-2009 02:29 PM
Split a line on positions before reading complete line vijaykrc Shell Programming and Scripting 1 02-18-2009 07:23 PM
how to append spaces(say 10 spaces) at the end of each line based on the length of th prathima UNIX for Dummies Questions & Answers 17 01-28-2009 04:10 PM
Reading a file using sh with spaces in filename jekl5 Shell Programming and Scripting 4 02-29-2008 10:18 AM
Reading a line including spaces aksarben UNIX for Dummies Questions & Answers 1 09-19-2007 08:39 PM



All times are GMT -4. The time now is 02:19 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