Sketsh

I have finally completed (mostly) a piece of software I've wanted for a long time.

I don't know how to nutshell it, exactly. It's a frontend for unix shell commands and terminal emulators that gives me flexibility in how it executes commands.

If I want to run a command in a terminal emulator:

# sketsh ls -al

a new terminal window pops up, executes the command (in this case, getting a file listing), and then drops me into a bash shell so I can enter more commands. in the meantime, it has added the command to my bash history so that it is immediately accessible for editing (in case I do something wrong). Simple and handy.

Now let's say that I'm writing a shell command or script that interacts with my graphical desktop environment, but isn't intended to use a terminal window at all. Like many programs, I use the console output to print debugging messages that aren't normally needed. If I execute a command by prepending sketsh with it's -C option,

# sketsh -C ls -al

it will skip executing the command in a terminal window entirely, and just run in the background. If something isn't working right, I can just delete that option from the command line in the script, and the command will execute in a window so I can see the output. When I've fixed any problems, I can then put the -C option back in, and the terminal goes back away. Neat and tidy.

At other times, I want a terminal window to pop up to execute the command, but I don't want it to hang around when it's done (unless, as before, I'm debugging it). For that, there is the -H option, which explicitly tells sketsh to close the window immediately after the command completes. To debug, simply take that option out of the line it's on, and a full terminal pops up and sticks around, with the command already in history for examination.

In this process, and over the years, I have learned a LOT about skillful BASH shell scripting - and how much more there is to it. This pleases me.

It's the perfect century to be a hacker.

User login

Connect
Sign in using Facebook