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
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 02:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy