On 10/17/07, Axel Liljencrantz <[EMAIL PROTECTED]> wrote: [...] > On 10/17/07, Fernando Canizo <[EMAIL PROTECTED]> wrote: [...] > > The only thing left is that sometimes one will really want to truncate a > > file. In bash this is achieved with this syntax (when noclobber is set): > > > > echo "nothing" >| file_to_be_truncated > > > > Now the syntax could be anything, it's not important, but it's important > > to have a way to overcome the default. > > That works very well, but there is one problem. Fish allows you to > redirect any file descriptor to a pipe using something like: > > make 2>| less > > The above will use the less pager to scroll through the output of > make. But that clashes with the suggested syntax for clobbering files. > We could chose to use something other than bash does, but when it > comes to picking arbitrary squiggles for operators, I see a pretty > strong benefit in making the same choices as the shell that must not > be named does in order to make migration between shells easier.
The trouble is the 'noclobber' option in the shell that shall not be named. It makes the '>' operator modal, so when people write '>' they expect something different if they are used to having the option set than if they are not. Since we don't want to replicate this bad effect in Fish, whatever '>' means in Fish, it will be incompatible with other shells for some users. So another solution is to habituate to using tab completion to avoid overwriting the file. If the file name completes, then the file exists and you are about to overwrite it. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users