General :: Can I Force Nohup Output To Screen Instead Of A File
Nov 9, 2010
When I run a script with nohup, the output is forced to the out.log file by default; is there a way to force the output to the screen instead of the file? I need to be able to see when my script gives me a "process started" message, and I don't want to clog up the system with log files.
I have a script, I am able to send the output of the script to both the screen and a file as shown below
Code:
./script | tee -a temp.log
I wonder is it possible to achieve same thing by executing some commands inside the script. As for other users, who execute the script it is not advisable to pipe the output of script with the help of tee command. Again, keeping |tee at the end of every line of the script doesn't seem to be advisable. I tried with this for couple of lines and it works. Is it possible to get the output of script to both screen and file by just executing name of the script, with some script tweaking ?
This command connects to remote machine and fetches data which gets continously streamed at screen(shown at terminal). If I do Ctrl+Z and bg to put it into background. Works Fine. But when i close the putty, it gets closed surprisingly.
I tried with nohup <command> & But wonder how to provide password.
Does the nohup command make a process immune to the HUP signal by sending the process to the background or does it achieve this by some other means? If it it does send it to the background, then are all background processes immune to the HUP signal? If yes, then we can make processes go to the background for getting immunity against HUP by using the bg command as well can't we?
I have two monitors attached to my video card. Primary monitor has a resolution equal to 1280x1024 and second has 1920x1200. My gdm login screen always appears on the second monitor even if it is switched off. My question is how to force gdm to show login screen always on primary monitor with resolution 1280x1024? I use Ubuntu 10.04.Now I'm ready to modify gdm sources if there is no such option in configuration files.
I have CeontOS machines connected to LCD via KVM which causes failure to properly detect screen resolution and I'm stuck with 800x600 until I reset X server with the LCD connected directly to the PC. How can I enforce higher screen resolutions?
EDIT: I followed the advise and left only one resolution in my xorg.conf but it didn't help.
I wonder if anyone can help, I've got an annoying problem with an Acer Revo running Ubuntu 9.10 with the latest NVidia drivers. The Revo is connected to my TV via an amp by HDMI. The Revo didn't seem to like this, I'm assuming due to some handshaking issue with the HDMI which meant that no signal was being passed. Therefore, in Xorg.conf I have used
Code: Option"UseEDID" "False" This makes the a picture appear but the highest resolution available is 640x480 (if I connect directly to my TV and comment out the "UseEDID" line the resolution is the proper 1920x1080).I have tried editing xorg.conf (the file is posted at the bottom) to force 1920x1080 resolution but nothing seems to work.
Code: # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 1.0 (buildd@palmer) Sun Feb 1 20:21:04 UTC 2009 Section "ServerLayout"
I have a new cluster of four OpenSuSE servers serving VM's for a development lab. I have been fighting the good Linux/OpenSuSE fight against established Windows environment and I am embarrassed by certain hardware behavior in X.The four machines are in a cluster with an inexpensive TrendNet TK-407 KVM. The Linux Boxes are Dell T3500's with NVidia Quadro NVS290. I am not running the NVidia proprietary driver.
The behavior is that X keeps placing the display in sleep/powersave mode. If I boot the machine everything works until X takes over upon which point it decides that the display is not there and places it into standby.I don't care whether the KVM may or may not be responding correctly to some monitor protocol, and neither do I care to know or learn about the various DPMS or monitor protocols. The important thing here is that Windows experiences no such behavior. The solution I seek is to configure X to force the signal out of the card, disregarding any DPMS or other protocols.
Is there one command that will let me record an entire terminal session (with any possible errors) to a text file while also seeing all output on screen too? I know it can be done for individual commands, but I'm looking to do this for an entire session where the individual commands will be normal (i.e., not piped into tee, etc.). It would be even better if the command prompt is captured too. The obvious utility of this makes me think someone surely has come up with a solution long ago (probably in the 60's).(I'm sure it goes without saying, but subsequent output in that session should be appended to the file. The file should contain the full history, with all output and errors, of the session.)
I am playing with my LAMP server1. why can i access a php file on the server only by typing http://serverip/file with no .php extension on?2. later i tryed to play with .htaccess, but when i uploaded it to the server it just disappeared, why is that
I'm having trouble getting 1080p out my xfx 9800gt that has an onboard hdmi socket. No doubt my HDTV is 1080p (panasonic TH-427PZ70B a few years old now), and it will do and has run at 1080p 60hz.
It auto detects the display as simply panasonic-tv and outputs at 1080i. As I've been running mythtv with tv tuners this actually worked quite well as dvb-t is interlaced anyway and most ofthe HD video files I play are 720p. However I would like to run it at 1080p for all the usual reasons- especially as I have some 1080p files I'd like to enjoy in all their glory!!
This doesn't seem to be ubuntu specific as mandriva behaves the same, and makes no difference if I use the open source (default with 9.10), the official nvidia package or as I've just tried 10.04 with default and nvidia.
I've searched around for nvidia hdmi 1080p etc but can't seem to dig up anything useful. Surely I should be able to force the graphics card to output standard 1080p 60hz?
Should I be able to do this through xrandr by setting a modeline or in xorg.conf or nvidia control pannel!?
Does anyone know how I can force single channel sound output? I'm deaf in one ear and want to mix the channels (especially when I need to use headphones).v
Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.
As an example : I have text file with orders and returns :
My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)
I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:
have a doubt, suppose in the script i include an exe type of file for ex. ./a.out, which takes input as a pdb file namely 1sn3.pdb, now i want my output text file to contain the name 1sn3.txt , how do i do that using the shell script
I was messing around with the screen orientation and thought it would be funny to orient it sideways. Big mistake The screen went black.I can force a shutdown, login and I get the same black screen. I tried hooking up an external monitor and the monitor showed no input so I'm guessing my laptop doesn't have that capability with Fedora.This is my main computer.
I want to add 50 new users, not on the server yet I want to add them all to group Accounting - with 1 option, not user by user I want to setup a default password for them all, and have it say something like 'You must now change password or no access will be permitted' Any other options I also want to do once, not for each user?
I have my Xubuntu box connected to a 1920x1200 LCD monitor via a KVM switch. If the KVM is set to the Xubuntu box when I boot, all's well, but if the KVM is set to the other machine, Xubuntu boots into a 800x600 resolution. This behavior started with Maverick, when I was running Lucid. the correct resolution was set no matter the position of the KVM switch. Is there some place in Maverick that I need to set the resolution to 1920x1200 so it is set correctly regardless of the KVM?
I recently started using Ubuntu 11.04. Everything works fine with my monitor directly connected to the computer. I get a default screen resoluton of 1680 x 1050, which is just fine.
However, when I connect the screen through a video splitter to be able to use a beamer, the screen resolution defaults to 1024x768. Moreover, Ubuntu then detects an unknown monitor and I cannot select a higher resolution.
I searched for modifications of xrandr en xorg.conf but I have to admit I don't understand what I've read. So my question remains: how can I force Ubuntu 11.04 to start with a screen resololution of 1680 x 1050 (without first connecting monitor only, that is).
I hereby add some information I retrieved with the screen connected without the splitter, so you can see what hardware is involved.
Code: dirk@LaboFysica:~$ xrandr Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192 VGA1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm 1680x1050 60.0*+ 1280x1024 75.0 60.0
I am creating a script to sync my important documents between two system. I want my script to generate a log file for the last action. can you suggest me a way to achieve this.Question: If I execute the rsync command with -v flag, it will print a lot of messages on the console. Is there any way. So, I can redirect these logs to a file?
This seems so simple when doing it from command line but I'm not able to accomplish it inside a script. I am trying to put output of following command into a text file:
CMD= mysql -uroot -psecret -e 'SHOW SLAVE STATUS G;' FIL=~/replication-`date +%F`.txt MAILTEXT=~/mailtext.txt touch $FIL $CMD > $FIL
Where FIL is a variable that contains path of the file to which to output command. I am running this command in a shell script from where I want to email contents of $FIL as attachment using mutt. But I am always getting 0 byte file. Also if I examine in directory the file is of 0 byte length.
I use 'grep -Ri "mypattern" .' to search for all files in the current directory recursively that contain "mypattern". But this command returns every single occurence, so that if a given file has several occurences of the pattern, the screen fills up pretty quick. More than likely, there's a way to restrict the output so that it only displays each file once, no matter how many occurences it contains, but I couldn't find how to do it.