Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

nohup command o/p redirection

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-09-2008
ammu ammu is offline
Registered User
 
Join Date: Jul 2006
Last Activity: 26 August 2010, 9:37 AM EDT
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 Unix and Linux 07-09-2008
radoulov's Unix or Linux Image
radoulov radoulov is offline Forum Staff  
Moderator
 
Join Date: Jan 2007
Last Activity: 23 April 2015, 3:05 PM EDT
Location: Варна, България / Milano, Italia
Posts: 5,690
Thanks: 184
Thanked 624 Times in 582 Posts

Code:
set +m
nohup ...

Sponsored Links
    #3  
Old Unix and Linux 07-09-2008
ammu ammu is offline
Registered User
 
Join Date: Jul 2006
Last Activity: 26 August 2010, 9:37 AM EDT
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 Unix and Linux 07-09-2008
radoulov's Unix or Linux Image
radoulov radoulov is offline Forum Staff  
Moderator
 
Join Date: Jan 2007
Last Activity: 23 April 2015, 3:05 PM EDT
Location: Варна, България / Milano, Italia
Posts: 5,690
Thanks: 184
Thanked 624 Times in 582 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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:56 AM.