$ cd workingdir
$ vim conffile
(edit, then within file press CTRL-Z, which suspends)
$ start_program
(notice errors or misbehaviours based on bad config)
$ fg
(edit config file some more, open different buffer)
** repeat untill things are happy **
This is a minimal use of job control, but it is nice.Other uses include juggling several programs at once, sometimes screen gets too annoying for simple progress monitoring of several processes at once. (One window per command for say 20 commands, makes it difficult to switch through to find the one vim one, or the sql prompt... 3 on the other hand is fairly easy).
Understanding how your system works is a different level from choosing the tools in the first place.
A large part of my job involves working with remote Linux servers, so I chose to invest time learning Linux command line tools and vim. Now I'm more productive in a terminal than in a GUI environment. I use common tools that are installed by default on Linux/Unix/OSX, so I can sit down anywhere and do my work, or SSH directly into my machine and have my exact work environment securely and without latency.
A gui is a poor mans command line.
Whichever I'm using there are always aspects of the work that you could do better with the other.
- browsing the web (sorry, lynx users)
- play games (not that I'm a gamer)
- desk-top publishing
- routing a PCB
- CAD
and so on...
But then, each of those has moments when you think to yourself 'Man, I wished I could script this' (well, maybe not the games).
remind() {
[[ $# -ge 2 ]] || { echo >&2 "Usage: $FUNCNAME time msg"; return 1; }
local sec="$(($1*60))"
( trap "echo \"\$sec seconds left\"" QUIT
while ((--sec > 0)); do sleep 1; done
say "${@:2}" # OS X only, replace with your favorite notifier
) 2>/dev/null &
}
$ remind 30 get the laundry
Query time remaining with kill -QUIT %jobspec. Good for systems that don't have at(1). ( sleep 1800 ; say "get the laundry" )& remind [minutes] [message]
Functions can be imported to your shell. =)Favorite notifier:
echo "${@:2}" | growlnotify -t Reminder -s -m -