Redirect STDOUT & STDERR to file and then on screen
Dear all,
redirecting STDOUT & STDERR to file is quite simple, I'm currently using:
But during script execution I would like the output come back again to screen, how to do that?
How can I redirect and append stdout and stderr to a file when using cron? Here is my crontab file:
*/5 * * * * /dir/php /dir/process_fns.php >>& /dir/dump.txt
Cron gives me an 'unexpected character found in line' when trying to add my crontab file.
Regards,
Zach Curtis
POPULUS (8 Replies)
Hi all,
I need to redirect stdout and stderr to a file in a ksh shell. That's not a problem. But I need also the correct exit code for the executed command. In the example below I redirect correctly the stdout & stderr to a file, but I have the exit code of tee command and not for the mv... (2 Replies)
Friends
I have to redirect STDERR messages both to screen and also capture the same in a file.
2 > &1 | tee file works but it also displays the non error messages to file, while i only need error messages.
Can anyone help?? (10 Replies)
Hi friends
I am facing one problem while redirecting the out of the stderr and stdout to a file
let example my problem with a simple example
I have a file (say test.sh)in which i run 2 command in the background
ps -ef &
ls &
and now i am run this file and redirect the output to a file... (8 Replies)
Hi
I am not if this is possible: is it possible in bach (or another shell) to redirect GLOBALLY the stdout/stderr channels to a file.
So, if I have a script
script.sh
cmd1
cmd2
cmd3
I want all stdout/stderr goes to a file. I know I can do:
./script.sh 1>file 2>&1
OR
... (2 Replies)
EDIT: Nevermind, figured it out! Forgot to put backslashes in my perl script to not process literals!
Hi everyone. I am trying to have this command pass silently. (no output)
chsh -s /bin/sh news
Currently it outputs.
I've tried....
&> /dev/null
1> /dev/null
2>&1 /dev/null
1>&2... (1 Reply)
Hello
I read a lot of post related to this topic, but nothing helped me. :mad:
I'm running a ksh script with subshell what processing some ldap command. I need to check output for possible errors.
#!/bin/ksh
...
readinput < $QCHAT_INPUT |&
while read -p line
do
echo $line
... (3 Replies)
Currently I am redirecting STDERR and STDOUT to a log file by doing the following
{
My KSH script contents
} 2>&1 | $DEBUGLOG
Problem is the STDERR & STDOUT do not have any date/time associated.
I want this to be something that i can embed into a script opposed to an argument I use... (4 Replies)
I have to redirect STDERR messages both to screen and also capture the same in a file but STDOUT only to the same file.
I have searched in this formum for a solution, but something like
srcipt 3>&1 >&2 2>&3 3>&- | tee errs
doesn't work for me...
Has anyone an idea??? (18 Replies)
Dear all,
redirecting STDOUT & STDERR to file is quite simple, I'm currently using:
Code:
exec 1>>/tmp/tmp.log; exec 2>>/tmp/tmp.log
But during script execution I would like the output come back again to screen, how to do that?
Thanks
Luc
edit by bakunin: please use CODE-tags like the... (6 Replies)
Discussion started by: tmonk1
6 Replies
LEARN ABOUT CENTOS
pcsc-spy
PCSC-SPY(1) PC/SC lite PCSC-SPY(1)NAME
pcsc-spy - A PC/SC spy command
SYNOPSIS
pcsc-spy [-n|--nocolor] [-d|--diffable] [-h|--help] [fifo_filename]
DESCRIPTION
pcsc-spy displays PC/SC calls of an application. It must be used with the libpcscspy.so library.
To be able to spy the PC/SC layer, the application flow must be modified so that all PC/SC calls are redirected. Two options are available:
- the application is linked with libpcsclite.so.1
- the application loads the libpcsclite.so.1 library using dlopen(3)OPTIONS -d, --diffable
Demove the variable parts (like handler values) from the output so that two execution can be more easily compared.
-h, --help
Display a short help text.
-n, --nocolor
Disable the output colorization (if you want redirect the output in a file for example).
-v, --version
Print the version of the pcsc-spy program plus a copyright, a list of authors.
EXAMPLES
Applications linked with libpcsclite.so.1
We will use the standard LD_PRELOAD loader option to load our spying library.
Example:
LD_PRELOAD=/usr/lib/libpcscspy.so pcsc_scan
Application loading libpcsclite.so.1
This is the case for the PC/SC wrappers like pyscard (for Python) and pcsc-perl (for Perl). The LD_PRELOAD mechanism can't be used. Instead
we replace the libpcsclite.so.1 library by the spying one.
You may use install_spy.sh and uninstall_spy.sh to install and uninstall the spying library.
Using the spying library without pcsc-spy is not a problem but has side effects:
- a line "libpcsclite_nospy.so.1: cannot open shared object file: No such file or directory" will be displayed
- some CPU time will be lost because of the PC/SC calls redirection
Starting the spy tool
pcsc-spy
If a command argument is passed we use it instead of the default ~/pcsc-spy FIFO file. It is then possible to record an execution log and
use pcsc-spy multiple times on the same log.
To create the log file just do:
mkfifo ~/pcsc-spy
cat ~/pcsc-spy > logfile
and run your PC/SC application.
Mac OS X
The installation is not automatic. In the pcsc-lite/src/spy directory do:
make framework
Then copy the PCSC.framework directory in /tmp
cp -a PCSC.framework /tmp
Copy the official PCSC.framework (binary only) in /tmp
cp /System/Library/Frameworks/PCSC.framework/PCSC /tmp
Run the application to debug as:
DYLD_FRAMEWORK_PATH=/tmp pcsctest
FILES
~/pcsc-spy FIFO file is used by libpcsclite.so.1 to send the raw log lines
SEE ALSO pcscd(8)AUTHOR
This manual page was written by Ludovic Rousseau <rousseau@free.fr>
pcsc-lite 1.8.8 2012-08-25 PCSC-SPY(1)