08-09-2006
Never mind - apparently I somehow went backwards on a file. The following command helps:
oslevel -rl 5200-04
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Is there any way to look for a directory path that is listed any number of lines *before* a keyword in an error message?
I have a script that is trying to process different files that are always down a certain portion of a path, and if there is an error, then says there is an error, contact... (2 Replies)
Discussion started by: tekster757
2 Replies
2. Shell Programming and Scripting
Assume file1 contains a list of strings.
My first script is scanning the file and deals with the lines with a certain patern in it:
grep 'somepatern' file1 \
while read LINE ; do
doSomethingAboutIt
done
Now, I need a second script that deals with the same lines (& do something... (3 Replies)
Discussion started by: bluemoon1
3 Replies
3. Shell Programming and Scripting
Hi,
I have a variable , lets say
a=/disk1/net/first.ksh
i need to grep "first.ksh"
everytime "a" gets changed dynamically and i do not know how many '"/" are there in my variable.
Can somebody help me out. (9 Replies)
Discussion started by: giri_luck
9 Replies
4. Shell Programming and Scripting
Hi,
I have to search for first occurenceof string str1 in a file(>5GB).
Now, after I have that , I have to search backwards from that offset till I get another string str2. I should also be able to get the
new string str2's offset.
Similarly, I look for last occurence of str1 and then... (1 Reply)
Discussion started by: finder255
1 Replies
5. Shell Programming and Scripting
I'm new to Unix scripting and I'm not sure if this can be done. Example:
search (grep) in a file for 'Control ID' and then replace with 4 blanks 7 bytes before 'Control ID.
input
"xxxxxx1234xxxxxxxControl IDxxxxxx"
output:
"xxxxxx xxxxxxxControl IDxxxxxx"
thanks! (7 Replies)
Discussion started by: jbt828
7 Replies
6. Shell Programming and Scripting
I'm having trouble writing a regular expression that matches the text I need it to. Let me give an example to express my trouble. Suppose I have the following text:
if(condition)
multiline
statement
else if(condition)
multiline
statement
else if(condition)
multiline
statement
else... (3 Replies)
Discussion started by: Altay_H
3 Replies
7. Solaris
what are the major Difference Between run level & init level (2 Replies)
Discussion started by: rajaramrnb
2 Replies
8. Shell Programming and Scripting
Hi,
I'm using the following to do a backwards search of a file for a string
sed s/^M//g FILE | nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=10 a=0 s="9005"|grep "policy "|sort -u |awk '{print $4}'|cut -c2-10
My issue is that because I'm looking back 10 lines it's... (11 Replies)
Discussion started by: SaltyDog
11 Replies
9. Red Hat
We have a RHEL 5.8 server at the production level and we have a Java application on this server. I know of the SSL certificate generation at the OS (RHEL) level but it is implemented on the Java application by our development team using the Java keytool. My doubt is that is the SSL generation can... (3 Replies)
Discussion started by: RHCE
3 Replies
10. Shell Programming and Scripting
Some help please:
Need to find string ||(everything in front of it)B0300|| and replace it with ||0|| globally
In:
16112121||||0||0||0||0||0||52||52||0||0||0||0||1507200053342B0300||1507200053342B0300||0||0||0||0700
Out:
16112121||||0||0||0||0||0||52||52||0||0||0||0||0||0||0||0||0||0700
... (4 Replies)
Discussion started by: drbiloukos
4 Replies
LEARN ABOUT POSIX
sd_seat_get_active
SD_SEAT_GET_ACTIVE(3) sd_seat_get_active SD_SEAT_GET_ACTIVE(3)
NAME
sd_seat_get_active, sd_seat_get_sessions, sd_seat_can_multi_session - Determine state of a specific seat
SYNOPSIS
#include <systemd/sd-login.h>
int sd_seat_get_active(const char* seat, char** session, uid_t* uid);
int sd_seat_get_sessions(const char* seat, char*** sessions, uid_t** uid, unsigned* n_uids);
int sd_seat_can_multi_session(const char* seat);
DESCRIPTION
sd_seat_get_active() may be used to determine which session is currently active on a seat, if there is any. Returns the session identifier
and the user identifier of the Unix user the session is belonging to. Either the session or the user identifier parameter can be be passed
NULL, in case only one of the parameters shall be queried. The returned string needs to be freed with the libc free(3) call after use.
sd_seat_get_sessions() may be used to determine all sessions on the specified seat. Returns two arrays, one (NULL terminated) with the
session identifiers of the sessions and one with the user identifiers of the Unix users the sessions belong to. An additional parameter may
be used to return the number of entries in the latter array. The two arrays and the latter parameter may be passed as NULL in case these
values need not to be determined. The arrays and the strings referenced by them need to be freed with the libc free(3) call after use. Note
that instead of an empty array NULL may be returned and should be considered equivalent to an empty array.
sd_seat_can_multi_session() may be used to determine whether a specific seat is capable of multi-session, i.e. allows multiple login
sessions in parallel (whith only one being active at a time).
If the seat parameter of any of these functions is passed as NULL the operation is executed for the seat of the session of the calling
process, if there is any.
RETURN VALUE
On success sd_seat_get_active() return return 0 or a positive integer. On success sd_seat_get_sessions() returns the number of entries in
the session identifier array. If the test succeeds sd_seat_can_multi_session returns a positive integer, if it fails 0. On failure, these
calls return a negative errno-style error code.
NOTES
The sd_seat_get_active(), sd_seat_get_sessions(), and sd_seat_can_multi_session() interfaces are available as shared library, which can be
compiled and linked to with the libsystemd-login pkg-config(1) file.
SEE ALSO
systemd(1), sd-login(7), sd_session_get_seat(3)
AUTHOR
Lennart Poettering <lennart@poettering.net>
Developer
systemd 10/07/2013 SD_SEAT_GET_ACTIVE(3)