Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-23-2002
mpegler mpegler is offline
Registered User
 

Join Date: Jun 2002
Posts: 2
Korn shell "select" command

I wish to display a full "ls -l" line per selection using the korn shell "select" command.

ie :
1) -rw-rw---- 1 u22adm tbs 6144 Mar 15 10:29 y.dat
2) -rw-rw---- 1 u22adm tbs 4096 Mar 15 10:29 y.idx
etc
etc

I can get spaces in :

select f in "a a" "b b" "c c"; do
> echo $f
> done
1) a a
2) b b
3) c c
#?
I can't do the same with inline execution :

select f in $( /bin/ls -l y* | sed 's/\(.*\)/"\1"/' ); do
echo $f
done
1) "-rw-rw---- 10) "-rw-rw----
2) 1 11) 1
3) u22adm 12) u22adm
4) tbs 13) tbs
5) 6144 14) 4096
6) Mar 15) Mar
7) 15 16) 15
8) 10:29 17) 10:29
9) y.dat" 18) y.idx"

How could I achieve this ?
Sponsored Links