Sponsored Content
Top Forums Shell Programming and Scripting decision, case, it then else? Post 14279 by gsaurus on Tuesday 29th of January 2002 11:35:59 PM
Old 01-30-2002
Question if you still need...

You will need to double check the syntax, but you might try something like this....

echo "enter log number"
read slog
db2inst=$(db2 "get instance") #cmd sub in ksh
if [ $db2inst = db2u ]; then
od /dir.../log && ls|grep $slog > newlog; cat..
rm newlog
else
od /dir.../log && ls|grep $slog > ...; cat ...rm snewlog
####

Just ideas. The "&&" causes the second command to only run if the first is successfull.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

2. Shell Programming and Scripting

Script needed to select and delete lower case and mixed case records

HELLO ALL, URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE. FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY and the CITY column records will be: Newyork washington ... (1 Reply)
Discussion started by: abhilash mn
1 Replies

3. Shell Programming and Scripting

convert upper case to lower case in ascript

I have a package to install and the installation script which does it . The files/directories names in the script are all lower case but the actual package has everything in upper case - file names, directories . I don't want to rename directories and files in the package - it has a lot of them . ... (2 Replies)
Discussion started by: vz6zz8
2 Replies

4. Shell Programming and Scripting

Script to Convert Upper case to Lower case

Hi All I have a script which extracts values from a Database (A persons name) and puts it into a variable in my script IE: $NAME However the Value in the DB is all in uppercase and contains the users first name and last name EG: > echo $NAME GRAHAM BOYLE > What I need is only the... (7 Replies)
Discussion started by: grahambo2005
7 Replies

5. Shell Programming and Scripting

data array needs to change upper case to lower case

Hi all, i have a data array as followes. ARRAY=DFSG345GGG ARRAY=234FDFG090 ARRAY=VDFVGBGHH so on.......... i need all english letters to be change to lower case. So i am expecting to see ARRAY=dfsg345ggg ARRAY=234fdfg090 ARRAY=vdfvgbghh so on........ If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies

6. Shell Programming and Scripting

sed ignoring case for search but respecting case for subtitute

Hi I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute": original becomes substitute Origninal becomes Substitute ORIGINAL becomes SUBSTITUTE I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies

7. Shell Programming and Scripting

[Solved] Change Upper case to Lower case in C shell

Is there a command that can switch a character variable from UPPER case to lower case? like foreach AC ( ABC BCD PLL QIO) set ac `COMMAND($AC)` ... end Thanks a lot! (3 Replies)
Discussion started by: rockytodd
3 Replies

8. Shell Programming and Scripting

Conversion from Upper Case to Lower Case Condition based

Hello Unix Gurus : It would be really appreciative if can find a solution for this . I have records in a file . I need to Capitalize the records based on condition . For Example i tried the following Command COMMAND --> fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies

9. Shell Programming and Scripting

Change first letter of a word from lower case to upper case

Hi all, I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like . ; : ! ?I found the following command sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies
ost::Slog(3)						     Library Functions Manual						      ost::Slog(3)

NAME
ost::Slog - The slog class is used to stream messages to the system's logging facility (syslogd). SYNOPSIS
#include <slog.h> Public Types enum Class { classSecurity, classAudit, classDaemon, classUser, classDefault, classLocal0, classLocal1, classLocal2, classLocal3, classLocal4, classLocal5, classLocal6, classLocal7 } enum Level { levelEmergency = 1, levelAlert, levelCritical, levelError, levelWarning, levelNotice, levelInfo, levelDebug } typedef enum ost::Slog::Class Class typedef enum ost::Slog::Level Level Public Member Functions Slog (void) Default (and only) constructor. virtual ~Slog (void) void close (void) void open (const char *ident, Class grp=classUser) (re)opens the output stream. Slog & operator() (const char *ident, Class grp=classUser, Level level=levelError) Sets the log identifier, level, and class to use for subsequent output. Slog & operator() (Level level, Class grp=classDefault) Changes the log level and class to use for subsequent output. Slog & operator() (void) Does nothing except return *this. void error (const char *format,...) Print a formatted syslog string. void warn (const char *format,...) Print a formatted syslog string. void debug (const char *format,...) Print a formatted syslog string. void emerg (const char *format,...) Print a formatted syslog string. void alert (const char *format,...) Print a formatted syslog string. void critical (const char *format,...) Print a formatted syslog string. void notice (const char *format,...) Print a formatted syslog string. void info (const char *format,...) Print a formatted syslog string. void level (Level enable) Sets the logging level. void clogEnable (bool f=true) Enables or disables the echoing of the messages to clog in addition to the syslog daemon. Slog & warn (void) Slog & error (void) Slog & debug (void) Slog & emerg (void) Slog & alert (void) Slog & critical (void) Slog & notice (void) Slog & info (void) Protected Member Functions int overflow (int c) This is the streambuf function that actually outputs the data to the device. Detailed Description The slog class is used to stream messages to the system's logging facility (syslogd). A default slog object is used to avoid confusion with the native syslog facility and to imply a logical relationship to the C++ clog(). The key difference is that the slog object sends it's output to the system logging daemon (typically syslogd) rather than through stderr. slog can be streamed with the << operator just like clog; a default slog object is pre-initialized, and you stream character data to it. The slog allows one to specify logging levels and other properties through the () operators. Hence, once can do: slog('mydaemon', SLOG_DAEMON, SLOG_EMERGENCY) << I just died << endl; or things like: slog('mydaemon', SLOG_DAEMON); slog(SLOG_INFO) << 'daemon initalized' << endl; The intent is to be as common-place and as convenient to use as the stderr based clog facility found in C++, and this is especially useful for C++ daemons. The std::flush manipulator doesn't work. Either the std::endl or std::ends manipulators must be used to cause the output to be sent to the daemon. When this class is used on a system that doesn't have the syslog headers (i.e. a non-posix win32 box), the output goes to the a file with the same name as the syslog identifier string with '.log' appended to it. If the identifier string ends in '.exe', the '.exe' is removed before the '.log' is appened. (e.g. the identifier foo.exe will generate a log file named foo.log) Author: David Sugar dyfet@ostel.com Minor docs & hacks by Jon Little littlej@arlut.utexas.edu system logging facility class. Member Typedef Documentation typedef enum ost::Slog::Class ost::Slog::Class typedef enum ost::Slog::Level ost::Slog::Level Member Enumeration Documentation enum ost::Slog::Class Enumerator: classSecurity classAudit classDaemon classUser classDefault classLocal0 classLocal1 classLocal2 classLocal3 classLocal4 classLocal5 classLocal6 classLocal7 enum ost::Slog::Level Enumerator: levelEmergency levelAlert levelCritical levelError levelWarning levelNotice levelInfo levelDebug Constructor &; Destructor Documentation ost::Slog::Slog (void) Default (and only) constructor. The default log level is set to SLOG_DEBUG. There is no default log facility set. One should be set before attempting any output. This is done by the open() or the operator()(const char*, Class, Level) functions. virtual ost::Slog::~Slog (void) [virtual] Member Function Documentation void ost::Slog::alert (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::alert (void) [inline] References levelAlert. void ost::Slog::clogEnable (boolf = true) [inline] Enables or disables the echoing of the messages to clog in addition to the syslog daemon. This is enabled by the default class constructor. Parameters: f true to enable, false to disable clog output Examples: slogTest.cpp. void ost::Slog::close (void) void ost::Slog::critical (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::critical (void) [inline] References levelCritical. void ost::Slog::debug (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::debug (void) [inline] References levelDebug. void ost::Slog::emerg (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::emerg (void) [inline] References levelEmergency. void ost::Slog::error (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::error (void) [inline] References levelError. void ost::Slog::info (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::info (void) [inline] References levelInfo. void ost::Slog::level (Levelenable) [inline] Sets the logging level. Parameters: enable is the logging level to use for further output void ost::Slog::notice (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::notice (void) [inline] References levelNotice. void ost::Slog::open (const char *ident, Classgrp = classUser) (re)opens the output stream. Parameters: ident The identifier portion of the message sent to the syslog daemon. grp The log facility the message is sent to Slog& ost::Slog::operator() (const char *ident, Classgrp = classUser, Levellevel = levelError) Sets the log identifier, level, and class to use for subsequent output. Parameters: ident The identifier portion of the message grp The log facility the message is sent to level The log level of the message Slog& ost::Slog::operator() (Levellevel, Classgrp = classDefault) Changes the log level and class to use for subsequent output. Parameters: level The log level of the message grp The log facility the message is sent to Slog& ost::Slog::operator() (void) Does nothing except return *this. int ost::Slog::overflow (intc) [protected] This is the streambuf function that actually outputs the data to the device. Since all output should be done with the standard ostream operators, this function should never be called directly. void ost::Slog::warn (const char *format, ...) Print a formatted syslog string. Parameters: format string. Slog& ost::Slog::warn (void) [inline] References levelWarning. Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::Slog(3)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy