Homemade echo command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Homemade echo command
# 1  
Old 11-04-2008
Homemade echo command

Hi everyone, this is probably very simple, but i haven't found anything in the forum, or maybe im just taking the wrong aproach...

I made a script to check a bunch of stuff, this script currently outputs it's findings to the screen, i need to log that output too, i was thinking to just make a new echo command to receive the standard output, and duplicating it, one for the screen, one to a file. well, like this

$checkCommand | doubleEcho

where doubleEcho would have something like this.

echo $1
echo $1 >> check.log

of course, that doesnt work, not that i ever tought it would... how can i catch the output of the checkCommand to use it in my script, is there another variable i can use for that?, or any other way to acomplish this?

the other option would be to just output everything into a file in the fist place and then just output the file... but there has to be a better way... i think.. hehe

thanks for your time. Smilie
# 2  
Old 11-04-2008
man tee
# 3  
Old 11-04-2008
Quote:
Originally Posted by Ikon
man tee
thanks dude Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Echo with cat command

Hi, I need to send an email in the below format: Hi All, body description on 12-Dec-2014 <a html table, which is there in Result.txt file> I am using the below command { echo "Hi All," echo "body description on $var_date " } | ( cat Result.txt ) | /usr/sbin/sendmail -oi -t ... (1 Reply)
Discussion started by: Prasannag87
1 Replies

2. Shell Programming and Scripting

Need to echo command successful if command is executed successfully

Hello, I have written a command n shell script : srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f If the above command executes successfully without error I need to echo "Service relocated successfully and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

3. Shell Programming and Scripting

Issue while using echo command

Hi, I have below shell script.. $ cat /tmp/1.txt NAME-HOST-APPLIED TIME-DATE $ cat /tmp/1.sh #!/bin/ksh echo "<html><table border size=1>" > /tmp/mail.html for i in `cat /tmp/1.txt` do a1=`echo $i |cut -d "-" -f1` a2=`echo $i |cut -d "-" -f2` a3=`echo $i |cut -d "-" -f3` a4=`echo $i... (4 Replies)
Discussion started by: thomasraj87
4 Replies

4. UNIX for Dummies Questions & Answers

Help me with Echo Command

Hi All I have the big statement which needs to be appended to the file MANUALLY without opening the file. So, i tried with echo command echo " failure ( 4446): for host xx.xx.xx.xxx trying to GET /index.html, wl-proxy reports: exception occurred for backend host 'xx.xx.xxx.xx/12210/12210':... (11 Replies)
Discussion started by: Kalaiela
11 Replies

5. Shell Programming and Scripting

Echo Command Help

Hi All I want to use the echo command to had some lines to a file but the lines i want to have contain " and ; here is my command system("echo user_pref("accessibility.typeaheadfind.flashBar", 0); > $profile"); but i think there are too many " and so it barfs n e ideas thanks A (5 Replies)
Discussion started by: ab52
5 Replies

6. Shell Programming and Scripting

Homemade activity monitor-ish

Hello - I didn't find this with search, but I'm guessing it's out there somewhere. Apologies for reposting if that's the case. I'm shell scripting on a 10.5.8 Mac. I want to make a program that runs in the background and periodically logs computer use, storing things like - cpu usage,... (2 Replies)
Discussion started by: Qroid
2 Replies

7. Shell Programming and Scripting

What does following echo command do?

Can anybody tell me what does following command do? # echo gsoc1 | ./configure_cmd.sh Regards, akash mahakode (1 Reply)
Discussion started by: akash_mahakode
1 Replies

8. UNIX for Dummies Questions & Answers

Command substitution within an echo

I'm trying to get this to work and I'm not really sure how to do it. echo $x | awk '{print $NF}' MODIFIEDThe output I'm trying to get should look like: dir1 MODIFIED Where dir1 will be the result of: $x |awk '{print $NF}'I'm sure there's something I'm supposed to put around that part... (3 Replies)
Discussion started by: ewoods
3 Replies

9. UNIX for Dummies Questions & Answers

Echo command with $$ $# $@

Hi, Good morning. Would you please explain to me what does it mean by the following command. echo "$$ $# $@" >> /opt/ftp_generic_send.log I know that something is being directed to log file, but not sure what exactly mean by those $$ and $# and $@ means. Thank you for your help.... (3 Replies)
Discussion started by: howdy
3 Replies

10. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies
Login or Register to Ask a Question