![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find cmd not working as expected | Vishal123 | Shell Programming and Scripting | 6 | 08-29-2007 03:11 AM |
| #/usr/bin/csh -f not working as expected? | effigy | Shell Programming and Scripting | 4 | 06-05-2006 06:00 PM |
| Var substitution in awk - not working as expected | videsh77 | Shell Programming and Scripting | 3 | 01-13-2006 01:57 PM |
| awk not working as expected with BIG files ... | videsh77 | Shell Programming and Scripting | 1 | 02-24-2005 04:15 PM |
| which not working as expected | osee | Shell Programming and Scripting | 2 | 09-07-2004 12:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ls not working as expected within ksh
Hi,
I use the command ls a\b\c\*.txt from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory When embeded in a ksh script `ls a\b\c\*.txt` it does not work - I get *.txt not found (even though there are files) I tried variations like having escape / and such but no use. Please help. Thanks much. GNMIKE ![]() |
|
||||
|
Hi,
Thanks for your help - Here is a part of my script... datapath would have the valye a/b/c datapatrn would have the value /*.txt (I tried /\*.txt also) batchsize would have a number such as 2 for example the result should go to a file $fileslst `ls -F1rt "$datapath" "$datafilepatrn"|head -"$batchsize">"$fileslist"` thanks again for your help |
|
|||||
|
Quote:
Code:
use something like datapath=$source_dir/a/b/c datafilepatern='*.txt' ls -F1rt $datapath/$datafilepattern | head -"$batchsize">"$fileslist" |
|
|||||
|
Change
`ls -F1rt "$datapath" "$datafilepatrn"|head -"$batchsize">"$fileslist"` to ls -F1rt "$datapath$datafilepatrn"|head -"$batchsize">"$fileslist" i.e. remove the backticks, and remove the space. Can't guarantee anything without seeing the rest of your script, but if my hunch is correct - that'll fix it. Cheers ZB |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|