1

I would like to do what is mentioned in How to match case insensitive patterns with ls?

except for ksh. Is it possible to do it without any pain(regex)?

2 Answers 2

5

There are 3 main implementations of ksh

  • the original one from David Korn (AT&T ksh), with two main branches: ksh88 and ksh93 (and for ksh93, many version with new features added for each).
  • pdksh, the public domain version (a free reimplementation of ksh88 with which it is mostly compatible) which is the base upon which is built the sh on some BSDs like MirOS or OpenBSD (hence mksh and oksh).
  • The zsh implementation. When called as ksh, zsh emulates the behavior of ksh88 with many of the features of ksh93 as well (and a few differences as well).

With ksh93:

print -r -- *.~(i:txt) 

or

print -r -- ~(i)*.txt 

With ksh88 or pdksh and its derivatives such as mksh:

print -r -- *.[tT][xX][tT] 

With zsh's implementation of ksh:

setopt nocaseglob print -r -- *.txt 

or

setopt extended_glob print -r -- (#i)*.txt 
1
  • That was very enlightening/informative. Thanks! Commented Jan 12, 2014 at 18:24
-2

With out regex, no!

But parsing 'ls' output with grep shouldn't be as much pain (if at all).

ls | grep -i '*xxx*' 
1
  • 1
    Parsing the output of ls is almost always a bad idea. mywiki.wooledge.org/ParsingLs Commented Jan 12, 2014 at 11:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.