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)?

4

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
  • That was very enlightening/informative. Thanks! – justsomeone Jan 12 '14 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*'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.