Error: "logger: illegal option -- p"


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Error: "logger: illegal option -- p"
# 1  
Old 02-17-2011
Question Error: "logger: illegal option -- p"

Hi All,

I am working on a Solaris 10 server. From this month start, it gives the error "logger: illegal option -- p" with each command. If I execute a script whose output shown on terminal, it comes many times.. Could you please help?
It comes only for my login. And I dont remember any changes made in dot profile..

Any idea how to get rid of this?
regards
Jaise
# 2  
Old 02-17-2011
Code:
Please post the contents of:
/etc/syslog.conf
And the output from these enquiry commands:
echo "$SHELL"
type logger
echo "$PS1"
echo "$PS2"
echo "$PS3"
alias|grep "logger"
grep "logger" .profile
grep "logger" /etc/profile

Are you logged in on the console?

# 3  
Old 02-17-2011
Hi,

Here is what you asked..
Code:
/etc/syslog.conf
---------------------------------------------------------------------------------
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.                             
# All rights reserved.                                                          
#                                                                               
# syslog configuration file.                                                    
#                                                                               
# This file is processed by m4 so be careful to quote (`') names                
# that match m4 reserved words.  Also, within ifdef's, arguments                
# containing commas must be quoted.                                             
#                                                                               
*.err;kern.notice;auth.notice                   /dev/sysmsg                     
*.err;kern.debug;daemon.notice;mail.crit        /var/adm/messages               
                                                                                
*.alert;kern.err;daemon.err                     operator                        
*.alert                                         root                            
                                                                                
*.emerg                                         *                               
                                                                                
# if a non-loghost machine chooses to have authentication messages              
# sent to the loghost machine, un-comment out the following line:               
#auth.notice                    ifdef(`LOGHOST', /var/log/authlog, @loghost)    
                                                                                                                              
                              
mail.debug                      ifdef(`LOGHOST', /var/log/syslog, @loghost)     
#                                                                               
# non-loghost machines will use the following lines to cause "user"             
# log messages to be logged locally.                                            
#                                                                               
ifdef(`LOGHOST', ,                                                              
user.err                                        /dev/sysmsg                     
user.err                                        /var/adm/messages               
user.alert                                      `root, operator'                
user.emerg                                      *                               
)                                                                               
                                                                                
local1.notice           @unixsyslog.XXXXX.XX.com    
------------------------------------------------------------------------------------
1) echo "$SHELL"
/bin/ksh 
2) type logger
logger is /export/home/nutil/logger
3) echo "$PS1"
"Not Set"
3) echo "$PS2"
>               
5)echo "$PS3"
#?         
6) alias|grep "logger"   
trap='logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL##*/} ${P
PID} $PWD TRAP EXECUTED" -- `fc -ln -0`; trap'                                  
7) grep "logger" /etc/profile     
        logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL} ${PPI
D} $PWD" -- : SH LOGIN `who am i | awk '{print $NF}'` `grep "^${LOGNAME}" /etc/p
asswd | awk -F: '{print $5}'`                                                   
          logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL} ${P
PID} $PWD" -- : SH LOGIN SHELL NOT SUPPORTED `who am i | awk '{print $NF}'` `gre
p "^${LOGNAME}" /etc/passwd | awk -F: '{print $5}'`                             
        logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL##*/} $
{PPID} $PWD" -- : KSH LOGIN `who am i | awk '{print $NF}'` `grep "^${LOGNAME}" /
etc/passwd | awk -F: '{print $5}'`                                              
        logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL##*/} $
{PPID} $PWD" -- : BASH LOGIN `who am i | awk '{print $NF}'` `grep "^${LOGNAME}" 
/etc/passwd | awk -F: '{print $5}'`                                             
      logger -p local1.notice -t "`uname -n` ${LOGNAME} ${USER} ${SHELL} ${PPID}
 $PWD" -- : THIS LOGIN SHELL NOT SUPPORTED `who am i | awk '{print $NF}'` `grep 
"^${LOGNAME}" /etc/passwd | awk -F: '{print $5}'`

Thanks for your reply..

Last edited by Scott; 02-19-2011 at 10:29 AM.. Reason: Please use code tags
# 4  
Old 02-17-2011
Though we are missing the grep on your .profile file (which might tell us where the alias is coming from), I think we get the idea.

Someone has set up extensive system logging using "logger" and somehow you are not executing a version of "logger" which allows the "-p" switch. (maybe something to do with your $PATH).

The alias of the unix "trap" command is scary. Especially the "fc" bit which is retrieving command history. I wonder if this is an attempt to implement some sort of restricted environment?
It would not surprise me if there are a large number of other aliases or other clever tricks.

Time to speak to your Systems Administrator.
# 5  
Old 02-23-2011
Hi,
Just wanted to mention one point.
This error comess only in ksh. Not in Bash.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Is "stat: illegal option -- -" an issue with hyphenated filename or flag problem?

Hi. I'm trying to install VMWare Workstation to run a virtual machine on my Mac OS, but running the bundle from bash(xterm) sh VMware-workstation-Full-11.0.0-2305329.x86_64.bundle (as suggested in install guide) comes up with error:stat: illegal option -- - usage: stat Digging... (5 Replies)
Discussion started by: defeated
5 Replies

3. Shell Programming and Scripting

How to solve this problem "Illegal Option"

I am just trying to read the password from command prompt that user should type with in 10 seconds, I am getting "read: Illegal option -t" #!/bin/bash ... (1 Reply)
Discussion started by: KarthikPS
1 Replies

4. UNIX for Dummies Questions & Answers

What is the meaning of "-s" option in "if" statement?

Hi Guys, I'm sorry but I can't find answer for this, what is the meaning of -s option in "if" statement on unix scipting. Please see sample below: opath=/home/output for i in N1 N2 N3 N4 do echo $i if then grep $i $opath/N5_CRAI > $opath/N5_$i.crai chmod 777 $opath/N5_$i.crai ... (7 Replies)
Discussion started by: rymnd_12345
7 Replies

5. 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

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

CRON JOB SCHEDULER throwing "option not allowed error"

Hi All, Pardon me if this turns out to be a dumb question. But I am trying to schedule a cron job for a my script which takes input options. So an entry in crontab would be something like: 1 * * * * run_report.sh -o out.csv -m monthly -e somename@email.com > cron_output.log 2> cron_error.log... (3 Replies)
Discussion started by: trueharsh
3 Replies

8. 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

9. 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

10. Programming

What is an "Illegal Instruction -Core Dumped"

Hai! i am working on Digital UNIX V3.2c Work station, my program uses Pro*C, C and X-Motif calls. i am facing problem while running application saying "Illegal Instruction Core Dumped". debugger dbx shows error at a line which shows "noname". when commenting large portion of the code it runs... (1 Reply)
Discussion started by: samn
1 Replies
Login or Register to Ask a Question