Aug 30, 2007 #1 Tdlearner Technical User Jun 17, 2004 13 US How come the following works just fine in korn shell on command line ? listpage="ls | more" ; listpage thanks,
How come the following works just fine in korn shell on command line ? listpage="ls | more" ; listpage thanks,
Aug 30, 2007 #2 Annihilannic MIS Jun 22, 2000 6,317 AU Not in any of my Korn shells it doesn't? Annihilannic. Upvote 0 Downvote
Aug 31, 2007 #3 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE THIS will work (korn shell alias): alias listpage="ls | more" ; listpage But only without the optional parameter for ls because "listpage /tmp" is then alias-expanded to "ls | more /tmp" If you want to use pipes and whatnot, better use a shell function listpage() { ls $* | more } listpage then gets to "ls | more" inside the function listpage /tmp gets to "ls /tmp | more" and both will work. HTH, p5wizard Upvote 0 Downvote
THIS will work (korn shell alias): alias listpage="ls | more" ; listpage But only without the optional parameter for ls because "listpage /tmp" is then alias-expanded to "ls | more /tmp" If you want to use pipes and whatnot, better use a shell function listpage() { ls $* | more } listpage then gets to "ls | more" inside the function listpage /tmp gets to "ls /tmp | more" and both will work. HTH, p5wizard