Monday, March 27, 2006

How To:The whimsical stty...2..Sending a foreground process to background

Sometimes just after entering the command for running a process which is going to talke lonnnngggg time,we realize that we shud have start it in background mode.

To do so..suspend it...the send it to the background.
The commands:

$lonnng_process --ran in fg mode

Press ^z.The process will be suspended( not killed ).

^Z[1] + Stopped (SIGTSTP) lonnng_process
$

Its telling the process has been suspended.
Now just tell it to send it to background.

$bg
[1] lonnng_process &
&

If u have suspended more than one processes then send it to bg by spefying number like:

$bg %1 --or
$bg %2

In the same way you can take a background process to foreground.

Labels:

How To:The whimsical stty...1..Erase by backspace key

The problem usually all newbie have faced that while writing a command wrongly in shell and then trying to rewrite it again.When you try to use backspace key or del key,junk characters starts coming.
To resolve it:

$stty erase [backspace]

Now lets talk more about stty.Infact you can check wat are the functions of your keys by this command:

$stty -a
speed 38400 baud;
rows = 24; columns = 80; ypixels = 0; xpixels = 0;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = ; eol2 = ; swtch = ;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3


Here "erase" will be done by pressing ^[cntrl]? key.

Labels:

how to Unix:Background process finished...No notification send on terminal..?

That might be possible that urs monitior variable is off.Just check it by:

$set -o

Current option settings
allexport off
bgnice on
emacs off
errexit off
gmacs off
ignoreeof off
interactive on
keyword off
markdirs off
monitor on
noexec off
noclobber off
noglob off
nolog off
notify off
nounset off
privileged off
restricted off
trackall off
verbose off
vi off
viraw off
xtrace off

If that monitor is off make it on by:
$set +o monitor

Labels: