Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-09-2008
Registered User
 
Join Date: Jul 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
nohup command o/p redirection

Hi
I am using nohup command in script(say nohup ls- ltr > somefile 2>&1 & ). I dont want any kind of output to be displayed on screen. When i tried the above nohup it still gives me some out put on screen like

[4] 2991
[3] Done >somefile 2>&1

Please you let me know what is to be done

Thanks in advance
Ammu
Sponsored Links
    #2  
Old 07-09-2008
radoulov's Avatar
--
 
Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 5,468
Thanks: 139
Thanked 538 Times in 506 Posts

Code:
set +m
nohup ...

Sponsored Links
    #3  
Old 07-09-2008
Registered User
 
Join Date: Jul 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for replying.
Still it gives me the output on the terminal

Thanks in advance
Ammu
    #4  
Old 07-09-2008
radoulov's Avatar
--
 
Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 5,468
Thanks: 139
Thanked 538 Times in 506 Posts
You don't see 'done', but you see the first one.
This is because your shell is interactive,
use a script:


Code:
$ cat s
#! /bin/bash

nohup "$@" > nohup.log 2>&1 &

$ ./s sleep 2
$ ps
   PID TTY      TIME CMD
 17788 pts/1    0:00 bash
 17810 pts/1    0:00 sleep
 17793 pts/1    0:00 bash

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh a nohup command headcr4sh Shell Programming and Scripting 2 12-01-2010 03:38 PM
Nohup command NycUnxer AIX 2 08-09-2010 10:58 AM
nohup command arvindng Shell Programming and Scripting 2 06-17-2009 10:40 AM
nohup command.. Amol21 UNIX for Dummies Questions & Answers 3 10-07-2008 11:45 AM
Nohup Command blazix UNIX for Dummies Questions & Answers 9 01-23-2005 05:01 PM



All times are GMT -4. The time now is 06:02 AM.