I worked like a trooper today, generalizing a several-year-old script which creates metadevices and metadevice mirrors for Solaris Volume Manager. It’s not rocket science, every admin has one, and it was time to make mine more generally useful. To that end, I rearranged my previous script, and abstracted out a set of shell functions, which pass the proper parameters to the SVM meta commands. The script was taking commmand-line parameters for root disk, mirror disk, and the disk slices that make up SVM’s meta databases.
And it was going swimmingly, and at about when it should have been quitting time, I thought it time for the script to clean up after itself, getting rid of temp files, etc. I moved all the clean up stuff into a function, called at the end of the script. One of the lines in the cleanup function was
rm ${0}
The good news is that the cleanup worked flawlessly. The bad news was that I hadn’t saved a copy of the script anyplace, being in the code-test-code phase. So, when I wanted to look at my handiwork again, there was a whole lot of not much there there.
Fortuitously, I had configured my gnome terminal with a gargantuan scrollback buffer. By trolling back through the buffer, I extracted my script, one function at a time, catt’ed all the functions, plus the main part of the script, into a file. I made not one, but two, backups of the file, reran it, and all was well.
Such things make me want to break out into a cussing fit, but I had no one to blame but myself. So, to the mighty gnome terminal scrollback buffer, this Shiner’s for you. And the script goes into RCS posthaste.
-k-
[stags]Work, sysadmin, scripting, gnome terminal[/stags]
A long long time ago, I worked at Dan River in Danville, VA. I wasn’t allowed to install Linux on my work desktop, and therefore *had to* use Windows NT to connect to Unix servers using Windows’ telnet. What I did was login with telnet, start emacs, then shell out from emacs in buffer mode. emacs would then acts as a terminal buffer as you describe.
This also worked great locally, the few times I had to work right at the RS/6000 console and had no terminal buffer to speak of to save my ass.