On Sat, Sep 14, 2013 at 04:23:35AM -0400, Nick Sabalausky wrote: > On Fri, 13 Sep 2013 19:56:14 -0400 > "Jonathan M Davis" <jmdavisp...@gmx.com> wrote: > > > > I guess that it's a matter of perspective. Personally, I find the > > Windows/DOS shell to be completely unusable and use git-bash when > > I'm forced to use Windows. Windows definitely has some things going > > for it (e.g. its graphics engine creams the horror that is X.org > > IMHO), but on the whole, I find that Linux is just way better for a > > power user like myself. Windows doesn't even come close to cutting > > it. > > > > While I definitely prefer bash to the windows prompt overall, there > are some places where I think windows makes the linux cmdline look > bad. Like launching a GUI program instead of a CLI: > > Windows (nice): > % program-cli file.txt > % program-gui file.txt > > Linux (wtf?!): > % program-cli file.txt > % program-gui file.txt >/dev/null 2>%1 &
That's only if you don't care about the output of the GUI program, which is usually an indication of errors. Well, unless the GUI program uses one of those stupid chatty toolkits that like to spew EVERYTHING to stdout/stderr, no matter how inane. It violates the rule that programs should be silent by default, and verbose only when asked to be or when an error condition is important enough to warrant soliciting the user's attention. But even then, I usually don't care about these random spews. They can be useful if the GUI program segfaults (which GUI programs are somehow very likely to, for some reason), then you at least have a possibly useful error message. Sending everything into /dev/null by default is a bit counterproductive. One situation where they can be annoying is when you're switching between vim (of course) and the gui program, and the random spewage messes up vim's TUI, then the solution is to hit ctrl-L, which *most* properly-written TUI programs understand as "something threw up all over your terminal, please repaint" (I believe ncurses has a default handler for this, which is nice since all ncurses-based TUIs will respond to ctrl-L in this way). But badly-behaved GUI programs like this I usually just start from a different terminal instead of the one I'm working on, so that the spewage doesn't bother me (and is still there for me to look at if the GUI program crashes, as they're all prone to, and I feel like looking into why they did). Ratpoison is really useful for this, since it's just two keystrokes to open a new terminal or switch to an existing dedicated spewage terminal, then start the GUI app, then two keystrokes to go back to your "main" terminal. Done this way, you don't even need to put the & at the end of the command (though I still do just out of habit). And if I need to start multiple GUI apps from the same spewage terminal, I just ctrl-Z to suspend the first one, 'bg' to background it (the afterthought equivalent of &), then start the second app. Or better yet, with ratpoison, since it's just two keystrokes to open a new terminal, I'd just open a new terminal, start the gui app with just a single &, then *kill* that terminal (also just 2 keystrokes in ratpoison) so that the OS sends all output to /dev/null for me without me ever needing to name /dev/null manually. :) That's 4 keystrokes compared to that idiotic verbose bash syntax for redirecting stdin/stderr to /dev/null (which I'm no fan of, just for the record), that takes ... let's see... 15+ keystrokes. Ratpoison FTW. :) > But that's not always right - sometimes you need this instead: > % gksudo program-gui file.txt >/dev/null 2>%1 & GUI programs that need sudo privileges are Teh Evil. I avoid them like the plague. Unless they're the system package manager, but in that case I'd use the CLI equivalents anyway, so this baroque dance is never necessary for me. :-P > But that's not always right either. On some systems it's: > % kdesudo program-gui file.txt >/dev/null 2>%1 & I have an intense hatred of anything GUI that asks for root privileges. GUI apps are just too fragile, too fat, too crash-prone, to entrust with root privileges. I have no confidence they will not also have nasty bugs that destroys or overwrites system files (a pet peeve of mine is gui programs that insist on creating stuff in $HOME that isn't their own app-specific dotfile or under their own dedicated dotdirectory -- some of them are quite insistent at recreating this detritus even after I manually delete them -- how am I to know if they won't do this to system files too?). So I never, ever, use gksudo or kdesudo. For me, root == strictly CLI-only. > Of course, Linux *also* provides many ways to do it *wrong*, which are > naturally more convenient: > > # Hangs your terminal until you close the gui app, > # which is so very useful an enormous 0% of the time: > % program-gui file.txt >/dev/null 2>%1 > > # Seems to work, but various warnings will be randomly > # spewed into your terminal while you're trying to use it. > % program-gui file.txt >/dev/null & > > # Same as previous, but with more random spewings. > % program-gui file.txt & [...] None of this are an issue if you've a fast way to starting up / switching to a specific terminal dedicated for containing spewage. :) (Of course, the fact the majority of gui programs love spewing like this is a sign of a fundamental pathology common to such programs, but that belongs in another rant. :-P It's one of the many reasons I have an aversion to all things GUI. In fact, in *my* book, a proper GUI program should automatically detach itself from the terminal at startup -- there are well-known, standard ways of doing this, but alas, most GUI developers don't care enough to do it.) T -- Designer clothes: how to cover less by paying more.