Here is a slightly improved version of the stub script:
/usr/local/bin/logit.ksh
called from you main script as
/usr/local/bin/logit.ksh scriptname args ... &
This will preceed each line of output from scriptname with the desired timestamp, processid, and command. However, the process ID will be that of the logit.ksh script not the actual scriptname. Using ptree, you'd be able to determine which logit.ksh goes with scriptname.
It's not perfect, but we're getting closer I hope.
I have a file with following file format -
DMCRH|||83000171|||14022008||0430|||8956612.23|J|||3571235|1378452|23468|6894|9234|
DMCRH|||83000215|||15092007||0480|||121.33|J|||LineID003|RefNumSP003|RefNumMem003|0004|0003|
What i need done is -
1. Cut the firt four digits of the date (eg 1402... (3 Replies)
Hi,
I have a file with below contents:
AAA
pqr,jkl,mnop,abcd
BBB
abc,pqrs,xyz,uvw,
efgh,uvw,
rpk
CCC
123,456,789
Need output file as below:
AAA,pqr,jkl,mnop,abcd
BBB,abc,pqrs,xyz,uvw,efgh,uvw,rpk (18 Replies)
Hi,
I have written a script which directs output of vmstat to a file...
The file consists of 15 lines in all.....
Through scripting I would like to re-format the file excluding first 4 lines... I donot wish to use vi editor and manually delete lines but i want this process to be... (2 Replies)
Hi,
Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it.
Input
======================
l_s := ' INSERT INTO TEST'
l_P PD := ' UPDATE INTO TEST'
l_D := ' DELETE INTO TEST'
This is test
Input
======================... (1 Reply)
Hi,
Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it.
Input
======================
l_s := ' INSERT INTO TEST'
l_P PD := ' UPDATE INTO TEST'
l_D := ' DELETE INTO TEST'
This is test
Output
======================... (1 Reply)
I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve.
The source file is compose of many lines with such format:
T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE
... (3 Replies)
HP hardware
Linux SLES version 10
shell script, ksh or sh
I am taking the output of the IML log and ultimately want to find only entries 30 days old. I am getting some unexpected results along the way.
hpasmcli -s "SHOW IML"
Event: 4 Added: 06/12/2012 13:56
INFO: Maintenance Note -... (3 Replies)
Hi Experts
I have a file which looks as follows
acttest /report/fieldsinf/acttest/LIVE/acttest Chris New
teatin1 /report/fieldsinf/eatin1/TEST/teatin1 Chris New
eatin1 /report/fieldsinf/eatin1/LIVE/eatin1 Chris New
tbectest ... (7 Replies)
Hi All,
i have a requirement where i need to format the input RAW file ( which is CSV) by using another mapping file(also CSV file). basically i am getting feed file with dynamic headers by using mapping file (in that target field is mapped with source filed) i have to convert the raw file into... (6 Replies)
Discussion started by: ravi4informatic
6 Replies
LEARN ABOUT OPENSOLARIS
endusershell
getusershell(3C) Standard C Library Functions getusershell(3C)NAME
getusershell, setusershell, endusershell - get legal user shells
SYNOPSIS
#include <unistd.h>
char *getusershell(void);
void setusershell(void);
void endusershell(void);
DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If
/etc/shells does not exist, the following locations of the standard system shells are used in its place:
/bin/bash /bin/csh
/bin/jsh /bin/ksh
/bin/ksh93 /bin/pfcsh
/bin/pfksh /bin/pfsh
/bin/sh /bin/tcsh
/bin/zsh /sbin/jsh
/sbin/pfsh /sbin/sh
/usr/bin/bash /usr/bin/csh
/usr/bin/jsh /usr/bin/ksh
/usr/bin/ksh93 /usr/bin/pfcsh
/usr/bin/pfksh /usr/bin/pfsh
/usr/bin/sh /usr/bin/tcsh
/usr/bin/zsh /usr/sfw/bin/zsh
/usr/xpg4/bin/sh
The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells.
The setusershell() function rewinds the file or the list.
The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells.
RETURN VALUES
The getusershell() function returns a null pointer on EOF.
BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved.
NOTES
Restricted shells should not be listed in /etc/shells.
SunOS 5.11 1 Nov 2007 getusershell(3C)