The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ls positional parameter vasuarjula Shell Programming and Scripting 1 02-14-2008 01:26 AM
how do I make dynamic parameter names? Or get the value of a parameter evaluated twi Awanka Shell Programming and Scripting 2 04-19-2007 06:37 PM
positional grep Manish Jha Shell Programming and Scripting 1 05-16-2006 11:33 AM
Positional Parameters ericelysia UNIX for Dummies Questions & Answers 15 10-23-2005 12:11 PM
Positional Parameters google Shell Programming and Scripting 2 09-26-2003 10:51 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-13-2008
Registered User
 

Join Date: Feb 2008
Posts: 16
ls positional parameter

Hi .
I am new to Unix. So i have a tough time.
we are using Korn Shell. I have a scenario where i have three files namely
xxx01,xxx02,xxx03. Now when i write ls xxx*|wc -l output is 3. But then i write `ls $1|wc -l` and pass xxx* as positional parameter (sh yyy.sh xxx*)
output is xxx01. other two files are not read. Why is this happening. Can i use the positional parameters in ls like commands. Please help
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-13-2008
Registered User
 

Join Date: May 2007
Location: Melbourne
Posts: 3
Try putting quotes around the 'xxx*'
Otherwise the string will be evaluated by korn shell before the parameters get passed to the script (expanding xxx* to 'xxx01 xxx02 xxx03' etc), and the script will only receive the first one ($1), and will only display that one.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:18 AM.


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