[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

DWIM in bash?!



Just a quick note about some behavior that surprised me - take a look
at this transcript (cut&paste, not edited):

thermo# cd /usr/unclude
/usr/include
thermo# pwd
/usr/include
thermo# 
GNU bash, version 2.00.0(1)-release (i586-debian-linux)

So, when did bash pick up DWIM (Do What I Mean) mode? And are there any
possible hazards (perhaps with rm and an unintended close match?)

O.K., I found it - quoting from bash.1:

shopt [-pqsu] [-o] [optname ...]
	...
    cdspell 	If set, minor errors in the spelling  of  a
		  directory component in a cd command will be
		  corrected.   The  errors  checked  for  are
		  transposed characters, a missing character,
		  and one character too many.  If  a  correc-
		  tion  is  found, the corrected file name is
		  printed, and the  command  proceeds.   This
		  option  is  enabled by default, but is only
		  used by interactive shells.

Ross

-- 
Ross J. Reedstrom, Ph.D., <rjr@bioc.rice.edu>  NSF Postdoctoral Fellow
W.M. Keck Center for Computational Biology
Department of Biochemistry & Cell Biology
Rice University, 6100 S. Main St.,  Houston, TX 77005


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: