Sponsored Content
Top Forums Shell Programming and Scripting "echo" outputs not appear into Log file Post 302901164 by rbatte1 on Monday 12th of May 2014 11:34:09 AM
Old 05-12-2014
Do you want output on screen and to a log file?
Code:
# echo "Hello world!" | tee /tmp/logfile
Hello world!

# cat /tmp/logfile
Hello world!

# echo "Hello world!" | tee /tmp/logfile              # Overwrites
Hello world!

# cat /tmp/logfile
Hello world!

# echo "Hello world!" | tee -a /tmp/logfile           # Appends
Hello world!

# cat /tmp/logfile
Hello world!
Hello world!

#


Robin

Last edited by rbatte1; 05-12-2014 at 12:38 PM.. Reason: Correcting my poor pasting of output
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

2. UNIX for Advanced & Expert Users

fsck.gfs2 outputs "RG recovery impossible; I can't fix this file system"

I have a CentOS release 5.2 (Final)host running kernel 2.6.18-92.el5 with at raid 10 that had two mirrored drives fail. The drives were re-inserted and now the raid shows healthy (for now). I tried to mount but got an Input/output error. I then attempted a fsck: fsck.gfs2 -y /dev/vg_01/uss_vol... (0 Replies)
Discussion started by: king_hippo
0 Replies

3. Shell Programming and Scripting

ksh script that echo " please insert your name " and store the output to a login.log file.

Hello All Nice to meet you all here in this forum, it's my 1rst time here i'm asking about a little issue that i face i added a ksh script that echo " please insert your name " and store the output to a login.log file. the script is working fine with normal telnet but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies

4. Shell Programming and Scripting

Redirect an "echo" to log and screen?

Hi folks. Within a script, i am trying to redirect the output of my commands to both log file and onscreen... Here is the section, where i write to the logfile. But i'd like to send the "echo "Creating LUN $2$COUNTER..." to screen as well... Can that be done? Thanks. { subtitle... (2 Replies)
Discussion started by: Stephan
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. AIX

echo $varibla | mail -s "subject" "xxx@xxx.com" not ruuning as expected

Hi Folks, As per the subject, the following command is not working as expected. echo $variable | mail -s "subject" "xxx@xxx.com" Could anyone figure it out whats wrong with this. I am using AIX box. Regards, (2 Replies)
Discussion started by: gjarms
2 Replies

7. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

8. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
XMMS2-LAUNCHER(1)					      General Commands Manual						 XMMS2-LAUNCHER(1)

NAME
xmms2-launcher - XMMS2 daemon launcher SYNOPSIS
xmms2-launcher [ -? / --help ] xmms2-launcher [ -l logfile / --logfile= logfile] [ -P pidfile / --pidfile= pidfile] [ --verbose ] DESCRIPTION
XMMS2 is a redesign of the XMMS (http://www.xmms.org) music player. It features a client-server model, allowing multiple (even simultane- ous!) user interfaces, both textual and graphical. All common audio formats are supported using plugins. On top of this, there is a flexi- ble media library to organise your music. xmms2-launcher starts xmms2d(1) in the background. The main feature is that it does not exit until the IPC system of XMMS2 is available, meaning that as soon as the xmms2-launcher process has exited successfully xmms2d(1) is ready to accept commands. xmms2-launcher includes command line options to change the way in which the daemon is invoked. These options are currently recognised: -l logfile / --logfile=logfile Write log file to logfile instead of the default log file location - P pidfile / --pidfile=pidfile Write the pid of xmms2d to the file specified by pidfile --verbose Increases the vebosity of xmms2-launcher -? / --help Show help options FILES
$XDG_CACHE_HOME/xmms2/xmms2d.log The default location for a file where the log output of xmms2d(1) is redirected. Usually ~/.cache/xmms2/xmms2d.log. SEE ALSO
xmms2d(1), http://xmms2.xmms.org HISTORY
The XMMS2 Project was started by Tobias Rundstrom and Anders Gustafsson. It is developed with their lead by a small group of contributers from all over the world. AUTHOR
This manual page was written by Alexander Botero-Lowry <alex@foxybanana.com> XMMS2-LAUNCHER(1)
All times are GMT -4. The time now is 03:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy