Sponsored Content
Full Discussion: Using tee
Top Forums Shell Programming and Scripting Using tee Post 302461334 by ctsgnb on Sunday 10th of October 2010 11:42:04 AM
Old 10-10-2010
Use or install the very usefull tool called "screen" or "GNU screen", you could then launch your script and detach your session so it is just "as if" it was running in background, and you can reattach to your session later
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tee problem

Hi you, This the code I have: function show_menu { echo " lalalalal" echo " 1. ...." echo " 2. ...." echo " 3. exit" read choice case $choice in 1) ... ;; 2) ...;; *) stop=1;; esac } (5 Replies)
Discussion started by: bensky
5 Replies

2. UNIX for Dummies Questions & Answers

How does tee work

Greetings to everybody. I would like to know if I can use the pipe and command tee to read from edited file and to write to him e.g. "sed '{s_A_B_}' file | tee file". :confused: I know it doesn't work with > but I don't know anything about it with tee. Thank you for your help. :) (1 Reply)
Discussion started by: Foxgard
1 Replies

3. UNIX for Dummies Questions & Answers

tee

hello how to append the hostname to each line of a file that is tee'd for example: tail -f file1 | tee file2 Iwant file2 to have the same new lines of file1 but with the hostname at the end or the beginning of each line. btw, is there more proper method than: tail -f file1 | tee... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

4. Shell Programming and Scripting

removing tee

Hi, I have a script where i want to log in details to the standard output as well as log file so that its easy for tracing purposes. I have used the "tee"command. The problem with this is my scripts lines are getting longer as for each line i have #!/bin/ksh echo "hello world" |... (4 Replies)
Discussion started by: pinnacle
4 Replies

5. Shell Programming and Scripting

tee

Someone recently advised me to use the tee command to write to standard out. Why would you pipe your commands to tee -a <filename> rather than just using >> <filename> ? For example: date|tee -a myfile seems to be the same as date >> myfile Is there a benefit to... (5 Replies)
Discussion started by: fracken_toaster
5 Replies

6. UNIX for Dummies Questions & Answers

tee command within variable

Hello If anybody knows something about the following please help me. I am using HP unix. In a script called test.txt i have the following command echo ok | tee test1.txt It works fine.It prints ok on the screen and creates the file test1.txt and puts in the file the "ok". In the same... (2 Replies)
Discussion started by: kostasch
2 Replies

7. Shell Programming and Scripting

tee + more command

script1: #!/bin/ksh more test.txt script2: calling the script1 #!/bin/ksh /tmp/script1.sh 2>&1 | tee tee.log where test.txt contains ~1200 lines. When I execute the script2 the more command does not print pagewise it goes to the end of the line, when I remove the tee command it... (4 Replies)
Discussion started by: prasad111
4 Replies

8. Shell Programming and Scripting

tee and functions

Greetings! My apologies if this has been answered elsewhere before. What I have is a function (as below) set up to append to either an error log or info log based upon input. myLOGGER () { if ]; then logfile=$elog lastERROR="$1" #used elsewhere in my script else... (2 Replies)
Discussion started by: reid
2 Replies

9. Shell Programming and Scripting

Help with tee command

In the current directory , I have seven files . But when I use the following command , it lists eight files ( 7 files + file_list.xtx) ls -1 | tee file_list.xtx | while read line; do echo $line ; done Does the tee command create the file_list.xtx file first and then executes the ls -1... (1 Reply)
Discussion started by: kumarjt
1 Replies

10. Shell Programming and Scripting

Mindboggling difference between using "tee" and "/usr/bin/tee" in bash

I'm on Ubuntu 14.04 and I manually updated my coreutils so that "tee" is now on version 8.27 I was running a script using bash where there is some write to pipe error at some point causing the tee command to exit abruptly while the script continues to run. The newer version of tee seems to prevent... (2 Replies)
Discussion started by: stompadon
2 Replies
dtach(1)						      General Commands Manual							  dtach(1)

NAME
dtach - simple program that emulates the detach feature of screen. SYNOPSIS
dtach -a <socket> <options> dtach -A <socket> <options> <command...> dtach -c <socket> <options> <command...> dtach -n <socket> <options> <command...> DESCRIPTION
dtach is a program that emulates the detach feature of screen. It is designed to be transparent and un-intrusive; it avoids interpreting the input and output between attached terminals and the program under its control. Consequently, it works best with full-screen applica- tions such as emacs. dtach is intended for users who want the detach feature of screen without the other overhead of screen. It is tiny, does not use many libraries, and stays out of the way as much as possible. SESSIONS A session in dtach is a single instance in which a program is running under the control of dtach. The program is disassociated from the original terminal, and is thus protected from your original terminal being disconnected for some reason. Other instances of dtach can attach themselves to a particular session. Input and output is copied between the program running in the dtach session, and the attached terminals. dtach avoids interpreting the communication stream between the program and the attached terminals; it instead relies on the ability of the attached terminals to manage the screen. Sessions are represented by Unix-domain sockets in the filesystem. No other permission checking other than the filesystem access checks is performed. dtach creates a master process that monitors the session socket, the program, and any attached terminals. MODES dtach has several modes of operation. It can create a new session in which a program is executed, or it can attach to an existing session. The first argument specifies which mode dtach should operate in. -a Attach to an existing session. dtach attaches itself to the session specified by <socket>. After the attach is completed, the win- dow size of the current terminal is sent to the master process, and a redraw is also requested. -A Attach to an existing session, or create a new one. dtach first tries to attach to the session specified by <socket> if possible. If the attempt to open the socket fails, dtach tries to create a new session before attaching to it. -c Creates a new session. A new session is created in which the specified program is executed. dtach then tries to attach itself to the newly created session. -n Creates a new session, without attaching to it. A new session is created in which the specified program is executed. dtach does not try to attach to the newly created session, however, and exits instead. OPTIONS dtach has a few options that allow you to modify its behavior. Each attaching process can have separate settings for these options, which allows for some flexibility. -e <char> Sets the detach character to <char>. When the detach character is pressed, dtach detaches itself from the current session and exits. The process running in the session is unaffected by the detach. By default, the detach character is set to ^ (Ctrl-). -E Disables the detach character. dtach does not try to scan input from the terminal for a detach character. The only way to detach from the session is then by sending the attaching process an appropriate signal. -r <method> Sets the redraw method to <method>. The valid methods are none, ctrl_l, or winch. none disables redrawing completely, ctrl_l sends a Ctrl L character to the program if the terminal is in character-at-a-time and no- echo mode, and winch forces a WINCH signal to be sent to the program. When creating a new session, the specified method is used as the default redraw method for the session. If not specified, the ctrl_l method is used. -z Disables processing of the suspend key. Normally, dtach will suspend itself when the suspend key is pressed. With this option, the suspend character is sent to the session instead of being handled by dtach. EXAMPLES
The following example creates a new session that has the detach character and suspend processing disabled. A socket is created in the /tmp directory for the session. $ dtach -c /tmp/foozle -Ez bash The following example attaches to the /tmp/foozle session if it exists, and if not, creates a new session using /tmp/foozle as the socket for the session. Processing of the suspend character is also disabled for the attach instance. $ dtach -A /tmp/foozle -z bash The following example attaches to the /tmp/foozle session, using the winch redraw method to redraw the screen. $ dtach -a /tmp/foozle -r winch The following example creates a new session and sets the default redraw method for the session to the winch redraw method. $ dtach -c /tmp/foozle -r winch bash AUTHOR
Ned T. Crigler <crigler@users.sourceforge.net>. SEE ALSO
screen(1) dtach 0.8 Jan 2008 dtach(1)
All times are GMT -4. The time now is 03:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy