Sponsored Content
Top Forums Shell Programming and Scripting Error "Cat Error: Bad Address " Post 18644 by ss_hpov on Monday 1st of April 2002 10:17:29 AM
Old 04-01-2002
Error "Cat Error: Bad Address "

Hi
I get an Error when i am trying to edit a file thru shell script.

ERROR IS "cat: write error: Bad address."

I don't get this error everytime i run the shell script.
Any idea ??

Here is the piece of code:

echo "Attempting to edit ${ProbeRuleFile}"
if [ -f ${ProbeRuleFile} ]
then
cp ${ProbeRuleFile} ${ProbeRuleFile}.${datestamp}
sleep 5

INSERT13="include \"\/opt\/Omnibus\/probes\/solaris2\/mform_fdf.rules\"!!#!# Here we temporarily
set @Agent, for the above cases"
cat ${ProbeRuleFile} | sed "s/# Here we temporarily.*/${INSERT13}/" | tr '!' '\n' > ${ProbeRuleF
ile}

echo "Setting Events Agent"
sleep 5
INSERT14="case \"formation\":! @Agent = \$agent! case \"unix\":"
cat ${ProbeRuleFile} | sed "s/case \"unix\":.*/${INSERT14}/" | tr '!' '\n' > ${ProbeRuleFile}

TEMP_LINE_NU=`grep -n "Details, \"\[0-9\]" ${ProbeRuleFile} | awk -F: '{print $1}'`
((TEMP_LINE_NU = $TEMP_LINE_NU + 1))
echo "line no. ${TEMP_LINE_NU}"
cat ${ProbeRuleFile} | sed "${TEMP_LINE_NU}s/discard/\#discard/" | tr '!' '\n' > ${ProbeRuleFile
}
echo "done \n"
else
echo "File: ${ProbeRuleFile} not found!!!"
#exit
fi
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies

2. Solaris

sendmail "root... User address required." error

I'm running sendmail (8.13.8+Sun/8.13.8/Submit) solaris 10. When I send mail to root at the command line (whether I use a full-qualified address or just root), I get the error message root... User address required. Sending mail to root (either at the command line or in a cron job),... (10 Replies)
Discussion started by: csgonan
10 Replies

3. HP-UX

ERROR: more than one instance of overloaded function "vprintf" has "C" linkage

Hi people! I've got this own library: -------------------------------------------- Personal.h -------------------------------------------- #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdarg.h> #include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies

4. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

5. Shell Programming and Scripting

Error-- : " bad string"

Hi All, wen i am running a script . its giveing the below error and hanging there Bad string ******************* Please enter the following details one by one --------------------------------------------- ... (6 Replies)
Discussion started by: manoj_dahiya22
6 Replies

6. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

7. UNIX for Dummies Questions & Answers

> 5 ")syntax error: operand expected (error token is " error

im kinda new to shell scripting so i need some help i try to run this script and get the error code > 5 ")syntax error: operand expected (error token is " the code for the script is #!/bin/sh # # script to see if the given value is correct # # Define errors ER_AF=86 # Var is... (4 Replies)
Discussion started by: metal005
4 Replies

8. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

9. Red Hat

/var/log/messages error "kernel: RPC: bad TCP reclen"

Hi, I am seeing the following errors in my environment, not sure why is it happening, any ideas? Thanks. kernel: RPC: bad TCP reclen 0x73746174 (non-terminal ) Dec 17 02:14:48 kernel: RPC: bad TCP reclen 0x63480000 (large) Dec 17 02:14:48 kernel: RPC: bad TCP reclen 0x633f0000 (large) Dec... (5 Replies)
Discussion started by: amarlinux
5 Replies
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), znew(1), zmore(1), zcmp(1), zforce(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. GZEXE(1)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy