Sorry, I wasn't clear. My issue is more to do with using the "tee" command which is causing the error checking (in the next if statement) to always pass regardless of the actual command whether it runs successfully or fails.
I understood your dilemma. That's why I gave that snippet. It is not only tee but for any chained commands: $? will report about the last command executed.
I'm not a complete novice at unix but I'm not all that advanced either. I'm hoping that someone with a little more knowledge than myself has the answer I'm looking for.
I'm writing a wrapper script that will be passed user commands from the cron...
Ex:
./mywrapper.sh "/usr/bin/ps -ef |... (1 Reply)
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)
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)
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
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)
for i in /tmp/*filex*; do echo $i |sed 's/\/tmp/infofiles\/infosize\/db\/files\///g';done 2>&1 |tee>output
|
The script works fine, but I cannot get the output to go to the screen and output at same time. I've tried tee -a tee and a number of commands but the only way I can get it working is... (3 Replies)
Hello All,
I have a requirement to redirect stdout and stderr to 'log' file and stderr alone to 'err' file.
Can someone please help me with this?
Thanks in advance (2 Replies)
OS version: RHEL 7.4
Shell : bash
I would like to capture command outputs using tee like # yum upgrade | tee yumupgradeLog
But, if I use tee command, I cannot respond to prompts like Is this ok : during command execution as shown below.
Is there a way I could use tee and still be able to... (4 Replies)
Discussion started by: kraljic
4 Replies
LEARN ABOUT DEBIAN
arpsnmp
ARPSNMP(8) System Manager's Manual ARPSNMP(8)NAME
arpsnmp - keep track of ethernet/ip address pairings
SYNOPSIS
arpsnmp [ -d ]
[ -f datafile ]
[ -s sendmail_path ]
[ -m addr ]
file [ ... ]
DESCRIPTION
Arpsnmp keeps track for ethernet/ip address pairings. It syslogs activity and reports certain changes via email. Arpsnmp reads information
from a file (usually generated by snmpwalk(8)).
The -d flag is used enable debugging. This also inhibits mailing the reports. Instead, they are sent to stderr.
The -f flag is used to set the ethernet/ip address database filename. The default is arp.dat.
(Debian) The -s flag is used to specify the path to the sendmail program. Any program that takes the option -odi and then text from stdin
can be substituted. This is useful for redirecting reports to log files instead of mail.
(Debian) The -m option is used to specify the e-mail address to which reports will be sent. By default, reports are sent to root on the
local machine.
Note that an empty arp.dat file must be created before the first time you run arpsnmp.
REPORT MESSAGES
(See the arpwatch(1) man page for details on the report messages generated by arpsnmp(1).)
FILES
/var/lib/arpwatch - default directory
arp.dat - ethernet/ip address database
/usr/share/arpwatch/ethercodes.dat - vendor ethernet block list
SEE ALSO arpwatch(8), snmpwalk(8), arp(8)AUTHORS
Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA.
The current version is available via anonymous ftp:
ftp://ftp.ee.lbl.gov/arpwatch.tar.gz
BUGS
Please send bug reports to arpwatch@ee.lbl.gov.
Attempts are made to suppress DECnet flip flops but they aren't always successful.
4th Berkeley Distribution 17 September 2000 ARPSNMP(8)