#!/bin/csh -f # keys # ----------------------------------------------------------------------------- # C shell script to show keys for a specified tool. Specify the tool via # the folder in which I keep its ./Tips subfolder. # Note: This was originally just an alias defined in .cshrc: # alias keys 'pushd \!* && cd ./Tips && less [Kk]ey*' # but that had a weird bug. Whenever the specified folder was not # found by the pushd command, the alias caused the entire tcsh shell # to abort. Why? # Didn't even run .login on the way out. Why? # The bug happened repeatably for years on various versions of # Mac OS X up to and including macOS Big Sur. # Did not happen on Linux. # Note: Must be executed via the source command or the directory is not # on the dirs stack afterwards. So, it's best to create an alias # in .cshrc like: # alias keys 'source ~/bin/keys \!*' # Also, without the source command, it doesn't have the cdpath # defined, so it often fails to find the specified folder. # ----------------------------------------------------------------------------- # Revision History: # $Log$ # ----------------------------------------------------------------------------- #echo $cdpath # Note: Use pushd, not cd, so the user can use pop afterwards, if they're # done looking for info in the specified folder. pushd $1:q if (! $status) then cd ./Tips if (! $status) then less [Kk]ey* endif endif