10-08-2004
How to redirect error message?
Hi,
I was trying to cat some files but not all of them exist.
I would get some messages like below:
cat: cannot open /mil2_usr1/time_logs/investigator/6334
cat: cannot open /mil3_usr1/time_logs/investigator/6334
cat: cannot open /mil3_usr1/time_logs/investigator/6352
I don't want to see them when I run my program.
Is there any way that I can redirect them somewhere else instead of the screen?
Thanks a lot!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I use this function (now modified with elif) for check if a pc is up: check_pc() {
$PING $PC 1 2> /dev/null
if ; then
check_dir #Other function
echo "Begin backup operation for $PC"
echo "$SMBTAR -s $PC -u $USER -p $PASS -x $SHARE$EXCL -t - | gzip -c >... (3 Replies)
Discussion started by: mbarberis
3 Replies
2. Shell Programming and Scripting
I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)
Discussion started by: barkath
3 Replies
3. Shell Programming and Scripting
Hi everyone, While I was trying to do
DATE=`date +"%Y%m%d_%H%M%S"`
STARTLOG=$TUXSTDDIR/start_$DATE.log
tmboot -y > $STARTLOG 2>&1
I got an error i.e. Ambiguous output redirect error. Here the first part is to boot the account so there is nothing wrong with that.... (6 Replies)
Discussion started by: pareshan
6 Replies
4. Shell Programming and Scripting
hi,
i want to redirect my output & error if generated to two different files. I
have written the code for redirecting the output, i dnt have ne idea how to
go abt it for errors. I tried spooling which was given in one of the
threads on this forum.But it didn't work.The script i wrote as a lot... (4 Replies)
Discussion started by: bankimmehta
4 Replies
5. Shell Programming and Scripting
This script has ambiguous redirect error.
...
cd $HOME
cd folder/work
# search all subfolders in work directory
find -mindepth 1 -maxdepth 1 -type d | while read directory
do
CUR_FOLDER="${directory#"./"}"
cd $CUR_FOLDER
chmod 644 *
for ff in *; do
if ; then
... (5 Replies)
Discussion started by: candyme
5 Replies
6. Shell Programming and Scripting
I'm having trouble piping grep results/error to a file. Why can't I redirect these messages into a file?
$ grep -r -o "pattern" * > log
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
Binary file foo4 matches
The log is created, but remains empty.
... (1 Reply)
Discussion started by: chipperuga
1 Replies
7. Linux
Hi,
I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help );
#!/bin/bash
#... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies
8. Shell Programming and Scripting
hi all,
i had the below script
filename = /osa/data1/output.txt
printf '%27s%53s\n' ' CURRENT DATE' 26-08-2014 >> $filename
iam getting the ambigiuos redirect error in the 2nd line of the code...please guide me
regards,
vasa saikumar (3 Replies)
Discussion started by: hemanthsaikumar
3 Replies
9. Ubuntu
Hello to everyone! I have a question about syslog.
I want put the messages of log in a particular file
but really i don't know how to do that or i don't get the results
that I want.
I do this:
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
int main (void)
{
... (4 Replies)
Discussion started by: Kovalevski
4 Replies
10. Shell Programming and Scripting
I have the below lines of code.
ls found*.tmp | while IFS= read -r entry; do
APP_NAME=$(sed -n -e 's/^.*<name>//' -e 's|</name>.*$||'p $entry | sed 's/\(<name>\|<\/name>\)//g')
echo "APP_NAME="$APP_NAME>$APP_NAME"_Deploy.cfg"
doneI m getting the below error while running the above script.... (4 Replies)
Discussion started by: mohtashims
4 Replies
LEARN ABOUT OPENSOLARIS
gzexe
GZEXE(1) General Commands Manual GZEXE(1)
NAME
gzexe - compress executable files in place
SYNOPSIS
gzexe [ name ... ]
DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a
penalty in performance). For example if you execute ``gzexe /bin/cat'' it will create the following two files:
-r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat
-r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~
/bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that
/bin/cat works properly.
This utility is most useful on systems with very small disks.
OPTIONS
-d Decompress the given executables instead of compressing them.
SEE ALSO
gzip(1), gznew(1), gzmore(1), gzcmp(1), gzforce(1)
CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the
PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep).
BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases,
using chmod or chown.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgzip |
+--------------------+-----------------+
|Interface Stability | Committed |
+--------------------+-----------------+
NOTES
Source for gzip is available on http://opensolaris.org.
GZEXE(1)