Operating System - Linux
1748204 Members
3138 Online
108759 Solutions
New Discussion юеВ

unix prefix commands...(nohub)

 
inventsekar_1
Respected Contributor

unix prefix commands...(nohub)

hi,
how many HPUX prefix commands are there?
[ p.s.,: prefix commands, which precede another commands. ex:nohub ]
Be Tomorrow, Today.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: unix prefix commands...(nohub)

Hi:

Aside from 'nohup' an exceedingly useful one is 'command'. 'command' enables the shell to treat the arguments as a simple command, suppressing the shell function lookup.

If you consider that one of the standard UNIX pardigmns is that processes have a standard input and a standard output stream, then the pipe ("|") is one of the most powerful "commands" enabling the the connection of process streams into "filters".

In addition to the pipe ("|") we could add the 'tee' command taht transcribes the standard input to the standard output and makes copies in the files.

Regards!

...JRF...


Ninad_1
Honored Contributor

Re: unix prefix commands...(nohub)

sekar,

Some more
xargs - see man xargs
time - to see execution times of a command.
nice - to run a command with specific priority

Regards,
Ninad
James R. Ferguson
Acclaimed Contributor

Re: unix prefix commands...(nohub)

Hi (again):

Another, less common operation is to do:

# sh -c string

This invokes a shell (in this example, the POSIX one) and reads commands from the string argument.

This is one way to create a separate process. You can see this by doing:

# date; sh -c "export TZ=GMT; date;"; date
Sun Apr 23 15:03:06 EDT 2006
Sun Apr 23 19:03:06 GMT 2006
Sun Apr 23 15:03:06 EDT 2006

As you can see, the GMT timezone was set only for the separate process. The original shell environment remained undisturbed.

I'll note in passing that could also create a separate process (environment) thusly:

# date; (export TZ=GMT; date); date

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: unix prefix commands...(nohub)

And to add to James' comments, you can temporarily assign a variable for just the duration of a command as in:

TZ=EST5EDT date
TZ=GMT0 date

In the above examples, the date command is run with a different TZ value. This is a shell construct rather than a command to precede a command.


Bill Hassell, sysadmin