Greg Wooledge wrote: ... > History expansion is a bloody nightmare. I recommend simply turning > it off and living without it. Of course, that's a personal preference, > and you're free to continue banging your head against it, if you feel > that the times it helps you outweigh the times that it hurts you.
i only use a few commands regularly and have them either aliased or stuck in history for me in my .bashrc (i start every session by history -c to get rid of anything and then use history -s "command" so pretty much my routine when signing on in the morning is to do !1 and then !2, !3 if i need to do a dist-upgrade. !1 is apt-get update & fetchnews !2 is apt-get upgrade !3 is apt-get dist-upgrade ... > ... and then, to add insult to injury, the command with the failed history > expansion isn't even recorded in the shell's history, so you can't just > "go up" and edit the line. You have to start all over from scratch, or > copy and paste the command with the mouse like some kind of Windows user. ha, yeah... i rarely use shell recording or other tools like that but once in a while i've been rescued by my habit of cat'ing the contents of a file to the terminal to look at it instead of using an editor (and having an infinite scroll window). songbird