On Wed, Apr 09, 2014 at 10:31:26AM +1000, Ian Munsie wrote:
> On 9 April 2014 08:14, Kevin Ballard <ke...@sb.org> wrote:
> >>> dangerous and surprising behavior to put into a terminal shell. For
> >>> example, `rm f` should _never_ automatically invoke `rm f*`.
> >>>
> >>> -Kevin
> 
> Kevin's example was that he has previously deleted all files starting
> with an f (which I've done on many occasions) and is now attempting to
> remove a single file called f (which I've done on many occasions), but
> your suggestion would cause fish to delete all files starting with an
> f again - I think that perfectly illustrates why automatically
> accepting suggestions in the shell is a really *really* bad idea.

well, haven't we all made ruinous typo's? i think yes. so they happen
and if you don't read what you type you're bound to do harm. but if you
do read carefully then it is _only_ the _first_ run that calls for full
attention. repeating the same command _less_ so. now your example is 
good case for emphasising the 'less' is that sentence.

and fish wouldn't be the first shell to enable this. zsh has it, just try
this:

zle-line-init() {
  zle history-incremental-search-backward
}
zle -N zle-line-init

i haven't had that now for over 3 years in my .zshrc. no catastrophes so
far.

> >> hello,
> >> i don't think you have that one either.
> >>
> >> rm -rf /<Enter>
> >>
> >> will execute 'rm /' in any shell anyway.
> 
> Whether intentional or not, his example was not that he has previously
> attempted to recursively remove /, and your argument relies on the
> system's rm command being the GNU version and defaulting to
> --preserve-root, which is not always the case, and is only a
> relatively new feature of GNU coreutils anyway.
> 
> -Ian

i really think you didn't read my argument. where are you getting the
GNU stuff? i didn't even know --preserve-root existed.
'rm -rf /' was meant as a semi-joke. given that user had the permission
to run it the 1st time, he-doesn't-get-to-run-it-the-second-time-anyway
was the point i was trying to make.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to