You could test the return code from the grep ---------- Post updated at 12:02 PM ---------- Previous update was at 11:37 AM ----------
One subtle thing I noticed in your initial post - you asked to find "similar" entries, but please note that the -x flag for grep that I posted above will find exact matches. This is probably what you mean.
Last edited by dsw; 01-26-2011 at 07:01 AM..
Reason: oops, forgot code tags.
Hi,
can someone pls help resolves this problem.
I have an Openserver 5.0.4 running but had this error after having a power failure problem.
error: cannot access termainl control database entry
I have a arnetport also install with wyse 60 terminals, non of the users can have access on... (2 Replies)
I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory)
diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//'
Is there a better more efficient way to find the lines in one file... (5 Replies)
Hello,
I have an output file showing database sizes across the 3 environments that I use (LIVE, TEST & DEVELOPMENT).
I am trying to write a script that lets me know if the size of a db on one environment is different to its corresponding db on the other environments.
Here is an example... (4 Replies)
Hi
I have a file
name1 xxxxx
name1 xxxxx
name1 yyyyy
name 1 zzzzz
name1 Uniprot Id 1234
name2 sssss
name2 eeeee
name2 bengamine
name2 Uniprot Id 3456
......................and so on
I have to capture Uniprot IDs only in a separate file so that output contain only
... (20 Replies)
I need to check if an entry input by the user is in a file. If so, I need to run a command, and if it does not exist then it should output entry does not exist.
So I have so far...
echo "Enter record:"
read record
//command || //command
Can I use an if statement to do this? (3 Replies)
Suppose I have a file containing :-
1 Apple $50
2 Orange $30
3 Banana $10
4 Guava $25
5 Pine@apple $12
6 Strawberry $21
7 Grapes $12
In the 5th row, @ character inserted. I want through sort command or by any other way this row should either on top or bottom.
By sort command garbage... (1 Reply)
Hi guys!!!
In my txt file there are a lot of pairs. Some of them are similar, so I am trying to add these pairs. For a example:
File:
ASP - GLN = 14
SER - GLU = 14
ARG - ASN = 13
ARG - TYR = 13
ASP - ARG = 13
GLU - ARG = 13
GLU - GLN = 13
ALA - ARG = 12
... (7 Replies)
Hi All
I had installed sudo in HP UX 11.3 and it is working fine but not able to make entry required to set permission similar to ROOT without using password (PASSWD) change option for define user in /etc/sudoers file
Please help if some know the syntex? :confused::wall: (2 Replies)
Hi dears
i have text file like this:
INPUT.txt
001_1_173 j nuh ]az
001_1_174 j ]esma. nuh ]/.xori
.
.
. and have another text
like this
TABLE.txt
j j
nuh word1... (6 Replies)
Discussion started by: alii
6 Replies
LEARN ABOUT SUNOS
ttyslot
ttyslot(3C) Standard C Library Functions ttyslot(3C)NAME
ttyslot - find the slot of the current user in the user accounting database
SYNOPSIS
#include <stdlib.h>
int ttyslot(void);
DESCRIPTION
The ttyslot() function returns the index of the current user's entry in the user accounting database, /var/adm/utmpx. The current user's
entry is an entry for which the utline member matches the name of a terminal device associated with any of the process's file descriptors
0, 1 or 2. The index is an ordinal number representing the record number in the database of the current user's entry. The first entry in
the database is represented by the return value 0.
RETURN VALUES
Upon successful completion, ttyslot() returns the index of the current user's entry in the user accounting database. If an error was
encountered while searching for the terminal name or if none of the above file descriptors are associated with a terminal device, -1 is
returned.
FILES
/var/adm/utmpx user access and accounting information
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO getutent(3C), ttyname(3C), utmpx(4), attributes(5)SunOS 5.10 27 Oct 1998 ttyslot(3C)