Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Drag and drop text clippings to run Terminal commands' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Drag and drop text clippings to run Terminal commands
Authored by: alys on Nov 08, '07 01:01:15AM

It's easy enough to do what you're suggesting with a very simple shell script. First, put all the commands into a plain text file (not RTF or any word processor format!), with one command on each line. Then, in between each command, insert a line that contains only the word "read". For example:

ls
read
echo "This is a message."
read
cat any_file.txt

"read" is a unix command that asks the user for input. The input must end with the return key, but you don't have to type anything before hitting return. This means that after each command executes, the shell script will wait until you have hit return before it continues. If you want some feedback to tell you when to hit return, you can do this:

ls
echo "Hit return to continue"
read
echo "This is a message."
echo "Hit return to continue"
read
cat any_file.txt



[ Reply to This | # ]