[Tcsh] glob-pattern that matches everything except a particular set of files

Eduardo Alvarez ealvarez at fastmail.com
Fri Jan 3 22:41:56 UTC 2020


Hello, list,

(At least) in bash, one can delete all files in a directory except for a particular file or set of files by using extended pattern matching operators, like so:

    shopt -s extglob
    rm !("exclude_me")

I tried doing the same thing with tcsh, but I'm unsure how. My first instinct was to use glob-patterns, like so:

    rm ^{sample1,sample2}

But as the man page states, this is not negated correctly. How would one go about achieving this task?

Regards,

-- 
  Eduardo Alvarez
  ealvarez at fastmail.com


More information about the Tcsh mailing list