![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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. |
|
|
||||
| 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 | Shell Programming and Scripting | 2 | 09-26-2003 10:51 AM | |
|
|
LinkBack | Thread Tools | 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 |
| Forum Sponsor | ||
|
|
|
|||
|
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. |
|||
| Google UNIX.COM |