PDA

View Full Version : How-to creation shell script


jtime
20th April 2008, 11:48
How do most people here create howtos? Could a shell script tool make creating howtos more accessible? When I'm trying to configure various apps, I might open a config files a few times to try out different configurations, and it's easy to lose track of documenting things.

What I'm suggesting is a tool, something like 'action' where you would tag your commands for your shell history.

action setting up new user

action: #01 set "setting up new user"

sudo adduser foo
Password:
Adding user `foo' ...
Adding new group `foo' (1002) ...
Adding new user `foo' (1003) with group `foo' ...
etc..
ls /usr/home/foo
action done
action: #01 done "setting up new user"
action list
#01 "setting up new user"
action show #01
sudo adduser foo
ls /usr/home/foo

jtime
20th April 2008, 11:57
in a more advanced iteration, this could be good to browse through the command history to find shell commands..I imagine a quake style ~ popup that shows recent shell history - id'd by actions

[-] #01 setting up new user
[ ].... sudo adduser foo
[ ].... ls /usr/home/foo
[-] #02 mount drive
[ ].... mount /drive/now/please /dev/hda
[ ].... mount /?
[ ].... mount /h
[#] nano /etc/hosts

so, if the user went up to one of the [-] boxes, it could collapse or expand the history from that section

it would be easy to edit history files, export to txt, identify which commands were used in which tasks simpler, and might be easier to use than control-r or searching through .bash_history