![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 05: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 09:37 PM |
| positional grep | Manish Jha | Shell Programming and Scripting | 1 | 05-16-2006 02:33 PM |
| Positional Parameters | ericelysia | UNIX for Dummies Questions & Answers | 15 | 10-23-2005 03:11 PM |
| Positional Parameters | Shell Programming and Scripting | 2 | 09-26-2003 01:51 PM | |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
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. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|