Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

nohup command o/p redirection

Shell Programming and Scripting


Closed    
 
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 Advisor  
Forum Adviser
 
Join Date: Jan 2007
Last Activity: 16 December 2015, 5:59 AM EST
Location: Варна, България / Milano, Italia
Posts: 5,690
Thanks: 184
Thanked 629 Times in 586 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 Advisor  
Forum Adviser
 
Join Date: Jan 2007
Last Activity: 16 December 2015, 5:59 AM EST
Location: Варна, България / Milano, Italia
Posts: 5,690
Thanks: 184
Thanked 629 Times in 586 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 Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 04:38 PM
Nohup command NycUnxer AIX 2 08-09-2010 11:58 AM
nohup command.. Amol21 UNIX for Dummies Questions & Answers 3 10-07-2008 12:45 PM
Nohup Command blazix UNIX for Dummies Questions & Answers 9 01-23-2005 06:01 PM



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