Thursday, October 18, 2012

How to find the current shell in UNIX Solaris Linux?

This method works perfectly in any shell.

NOTE: $$ holds the process id of current shell.

[penguin@cheetah:/home/penguin]#ps | grep -i `echo $$`
 18530             0:00 ksh

[penguin@cheetah:/home/penguin]#bash
bash-3.00$ ps | grep -i `echo $$`
 18574 pts/196     0:00 bash

bash-3.00$ csh
cheetah% ps | grep -i `echo $$`
 18578 pts/196     0:00 csh

cheetah% tcsh
> ps | grep -i `echo $$`
 18590             0:00 tcsh


Monday, October 1, 2012

What is meant by Pipe and Filter in Unix or Linux?

PIPE:
Pipe is a way of passing data from standard output of one process to standard input of another process.

Filter:
It is a program that by default reads from standard input and writes to standard output.