On 6/14/10 6:45 AM, mika.p.maki...@webinfo.fi wrote: > Hello, > I suppose I have found a new feature to Bash. > If user needs to rename a file and the file is in directory > /home/user/a/b/c/d/e/file, > user needs to write command mv /home/user/a/b/c/d/e/file > /home/user/a/b/c/d/e/fileB. > This command contains the directory written two times. so if Bash would > remember > directory, it would be possible to retrieve directory from memory the second > time it is > needed. > That way user does not need to rewrite the same long directory again. there > should > be a key combination to retrieve the directory from memory to command line.
There is, but you have to save it yourself. If you're using emacs editing mode, you can use ^W to save the first pathname, and ^Y to retrieve it. > I also have three other feature propositions. > > a) > > In Bash scripts (and more generally in any programming language), there could > be > a feature, which, when user presses F1 in place of a source code line, would > tell > in plain English what the source code line does. that would be useful for > those who > are learning new programming language and need to know what a source code > does. > also hard-to-find typos would be revealed this way. There are tools that already do part of this -- syntax-directed editors, for instance. The command-to-English-explanation system is a really daunting task. The other two proposals don't belong in bash. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/