The UNIX and Linux Forums  


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



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
passing a list of dynamic names to a "PS" command in shell script? sachin.tendulka Shell Programming and Scripting 3 11-21-2007 04:18 AM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 04:15 AM
korn shell "loops & arrays" muzica Shell Programming and Scripting 7 09-23-2004 04:02 PM
Find -name "*.txt" in Korn Shell Script jwperry Shell Programming and Scripting 3 07-19-2002 01:51 PM
How to convert the "select" function into a "poll" function rbolante High Level Programming 1 07-10-2001 11:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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 ?
  #2 (permalink)  
Old 06-23-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Try:

Code:
IFS="
"
select f in $(ls -ld y*) ; do

  #3 (permalink)  
Old 06-23-2002
mpegler mpegler is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 2
Thanks.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0