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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Position of a string shreethik Shell Programming and Scripting 5 09-22-2007 06:10 AM
Cursor position gefa UNIX for Dummies Questions & Answers 3 03-17-2006 07:07 AM
Character position akrathi UNIX for Dummies Questions & Answers 4 10-26-2005 01:06 AM
Get the cursor position bestbuyernc Shell Programming and Scripting 0 07-27-2005 01:59 PM
VI 'go to position #' command hedrict UNIX for Dummies Questions & Answers 2 10-11-2002 06:35 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 316
Stumble this Post!
Cut position as a variable

Hi All,

I wish to cut an input by using the below command but i would want to have the cut position as a variable.
For eg, the position number is 11 now and i wish that this number is being assigned to a variable before putting into the cut function.
Can this be done ?
Can any expert help? I am using csh by the way.

Code:
cut -c11-
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Sep 2005
Location: Slovenija
Posts: 20
Stumble this Post!
Code:
</> PAR=2
</> ls -l | cut -c${PAR}
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0