Back in 2010, rcrsn51 wrote,
This has been very useful for me in my Linux tinkering since I can click a script and have it run itself in a terminal for input and output.You may have scripts that you use regularly, but must open a terminal window to run them. Here is a simple method for making a script clickable. You can then put a shortcut to the script on your desktop.
Just place the following three lines at the top of the script (without any blank lines):
Code:
#!/bin/sh
tail -n +4 $0 > /tmp/script.txt
exec rxvt -e sh /tmp/script.txt
I recently stumbled on a simple alternative that seems to work:
Code: Select all
#! /bin/bash
[ -t 0 ] || exec rxvt -e $0
rest of the script
Are there are other neat ways to accomplish the same?