Hi Forum,
I am struggling with the for loop in shell script.
Let me explain what is needed in the script.
I have a file which will conatin some strings like
file1
place1
place2
place3
checkpoint
some other text
some more text
Now what my requirement is
the words ... (2 Replies)
I need to write a script, which takes the input a log file and create output file with acct no's line by line from selected records with text like (in red) :
18:51:18 | 217863|Acct 0110855565|RC 17608| 16 Subs| 1596 UsgRecs| 2 Secs| 430 CPUms| prmis2:26213 <MoveUsage d
aemon needs to run... (7 Replies)
I need to run sql script from shell script which takes the input from a file and contents of file will be like :
12345
34567
78657
and query will be like :
select seq_nbr from bus_event where event_nbr='12345';
select seq_nbr from bus_event where event_nbr='34567';
select seq_nbr... (1 Reply)
I have a txt file with contents of acct nbr's like:
22222222222
33333333333
33445566778
I need to write a script which takes each acct nbr in the file and run the query like:
select seq_nbr from event where acct_nbr='22222222222'
and the query's output should be passed to a... (0 Replies)
Hi,
I am trying to export the data to an .ixf file.
I have read the table names from a .dat file and those table name should be passed to the select * from schema.TABLENAME query .
I am trying the below loop
while read TABLE; do
db2 EXPORT TO ~/data_export/$TABLE.ixf OF IXF MESSAGES... (5 Replies)
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Thank you for taking the time to read my issue. I need to set up a script to run from a wagon wheel type toplogy where 1 server needs to query about 10 to 15 remote servers for duplicate values in a database table. If a duplicate value is found, send an email to me( or wall command to console).... (5 Replies)
Hi All,
I have a command which provide this output
symaccess -sid 624 show PG_E36_PG6P -type port |grep FA
FA-5G:1
FA-6G:0
FA-11G:0
FA-12G:1
I need to use the value in loop like this (5 Replies)
Run a loop that will search for a file to thousand machine and know who owns the file
$ for i in abc{01..02}
> do
> echo -n $i
> ssh $i "sudo find / -name .ssh -exec ls -l {} \;|grep id"
> done
abc01-rw-------. 1 root root 1675 Nov 10 2018 id_rsa
abc01-rw-------. 1 root root 1675 Nov 14... (6 Replies)
I would like to call a .sql file from a .sh file in linux. The .sql file will contain queries to MySQL database.
I am able to call the .sql file by running .sh file in linux, but the sql query is not working. Below is my syntax. The select statement is throwing below error.
./sample.sql: line... (1 Reply)
Discussion started by: qytan
1 Replies
LEARN ABOUT OPENSOLARIS
acct
acct(2) System Calls acct(2)NAME
acct - enable or disable process accounting
SYNOPSIS
#include <unistd.h>
int acct(const char *path);
DESCRIPTION
The acct() function enables or disables the system process accounting routine. If the routine is enabled, an accounting record will be
written in an accounting file for each process that terminates. The termination of a process can be caused by either an exit(2) call or a
signal(3C)). The effective user ID of the process calling acct() must have the appropriate privileges.
The path argument points to the pathname of the accounting file, whose file format is described on the acct.h(3HEAD) manual page.
The accounting routine is enabled if path is non-zero and no errors occur during the function. It is disabled if path is (char *)NULL and
no errors occur during the function.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The acct() function will fail if:
EACCES The file named by path is not an ordinary file.
EBUSY An attempt is being made to enable accounting using the same file that is currently being used.
EFAULT The path argument points to an illegal address.
ELOOP Too many symbolic links were encountered in translating path.
ENAMETOOLONG The length of the path argument exceeds {PATH_MAX}, or the length of a path argument exceeds {NAME_MAX} while
_POSIX_NO_TRUNC is in effect.
ENOENT One or more components of the accounting file pathname do not exist.
ENOTDIR A component of the path prefix is not a directory.
EPERM The {PRIV_SYS_ACCT} privilege is not asserted in the effective set of the calling process.
EROFS The named file resides on a read-only file system.
SEE ALSO exit(2), acct.h(3HEAD), signal(3C), privileges(5)SunOS 5.11 20 Jan 2003 acct(2)