Sponsored Content
Top Forums Shell Programming and Scripting Redirect an "echo" to log and screen? Post 302413581 by Stephan on Friday 16th of April 2010 09:36:28 AM
Old 04-16-2010
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.
Code:
{

subtitle "Generating LUNS"

${LOGIN}

while [ $COUNTER -lt $1+1 ]
        do
        echo "Creating LUN $2$COUNTER..."
        ./axiomcli "sanlun -add -sanlun $2$COUNTER -maxsize $3 -size $4 -priority $5 -accessbias $6 -iobias $7"
        COUNTER=`expr $COUNTER + 1`
        done

} >> $LOGDIR/$SCRIPT.$AXIOM.$2.$STAMP


Last edited by jim mcnamara; 04-16-2010 at 10:39 AM.. Reason: code tags
 

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. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 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

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
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

What is the right way to redirect script output use ">" or ">>" ?

Which one of the following are more accurate and why? nohup myScript.sh 1>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh 1>>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 &... (3 Replies)
Discussion started by: kchinnam
3 Replies

9. Shell Programming and Scripting

"echo" outputs not appear into Log file

Hi, - From Script : echo "************************************" echo "NEW_ORACLE_SID : " ${NEW_ORACLE_SID} echo "************************************" echo "" >> /auto_clone/${NEW_ORACLE_SID}/logs/clone_PERP12R.log echo... (4 Replies)
Discussion started by: htaieb1
4 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
TYPES.DB(5)							     collectd							       TYPES.DB(5)

NAME
types.db - Data-set specifications for the system statistics collection daemon collectd SYNOPSIS
bitrate value:GAUGE:0:4294967295 counter value:COUNTER:U:U if_octets rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295 DESCRIPTION
The types.db file contains one line for each data-set specification. Each line consists of two fields delimited by spaces and/or horizontal tabs. The first field defines the name of the data-set, while the second field defines a list of data-source specifications, delimited by spaces and, optionally, a comma (",") right after each list-entry. The format of the data-source specification has been inspired by RRDtool's data-source specification. Each data-source is defined by a quadruple made up of the data-source name, type, minimal and maximal values, delimited by colons (":"): ds-name:ds-type:min:max. ds-type may be either ABSOLUTE, COUNTER, DERIVE, or GAUGE. min and max define the range of valid values for data stored for this data-source. If U is specified for either the min or max value, it will be set to unknown, meaning that no range checks will happen. See rrdcreate(1) for more details. FILES
The location of the types.db file is defined by the TypesDB configuration option (see collectd.conf(5)). It defaults to collectd's shared data directory, i. e. prefix/share/collectd/. CUSTOM TYPES
If you want to specify custom types, you should do so by specifying a custom file in addition to the default one (see FILES) above. You can do that by having multiple TypesDB statements in your configuration file or by specifying more than one file in one line. For example: TypesDB "/opt/collectd/share/collectd/types.db" TypesDB "/opt/collectd/etc/types.db.custom" Note: Make sure to make this file available on all systems if you're sending values over the network. SEE ALSO
collectd(1), collectd.conf(5), rrdcreate(1) AUTHOR
collectd has been written by Florian Forster <octo at verplant.org>. This manpage has been written by Sebastian Harl <sh at tokkee.org>. 5.1.0 2012-04-02 TYPES.DB(5)
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy