Actually, what I'm trying to do is remove duplicate pairs from a file like this:
I find out it doesn't really work if I redirect the file into a while-loop that uses read to read a line, like this:
I got the idea because while read works line by line from the beginning of the file the swapped line is always located behind the other one so if I remove it read will never see it. But apparently the entire original file is still available to read no matter what I remove.
Is there is a better approach?
Assuming the fields in your input file are whitespace separated, you could try this approach:
These 2 Users Gave Thanks to Scrutinizer For This Post:
Hi All,
Very need help about format syntax on solaris 10.
I have done install Solaris 10 OS on sun fire v245 but currently i have a problem to use "format" command to display partition info for my hard drive.
i cannot enter the format menu, below is captured display :
# format
Searching... (7 Replies)
Hi all,
Just subscribed to this forum. Not a regular user of Unix.:)
I did the following:
We have a directory structure /a/b/c5/
Where c5 is the only directory inside b.
export ANOOP=/a/b/c*/
echo $ANOOP=/a/b/c5/
I have to create a symbolic link to anoop.txt in the directory... (2 Replies)
Hiii... There...
I am making a Script in which I am taking the value of a variable "var"
through key board.
But I want, if no values are supplied for "var" for more than 5 seconds then script shuld automatically exit.Script is as follow :
#cat abc
#!/bin/bash
echo "Enter Your Choice : "... (4 Replies)
I am looking at installing PiKdev which needs libqt3-mt and kdelibs4-dev. The installed package is qt-r1008952-i486-1 which claims to be a gui toolkit. find / -name "*libqt*" yields nothing with mt just a lot of support, compatible, and access widgets. Normally I would consider this a no go but... (0 Replies)
Hi,
I am a little bit confusing of using find command.
Actually, I am planning to delete the files whatever the files are existing in the day before yesterday. So, I am writing the command like this.
find . -name "*.txt" -ctime -2 { here I am confusing, if I will use +2 or +1 also I am... (5 Replies)
Sed garbled error. Cannot determine why the sed command to insert a line at the beginning of a file will not work on declared variables.
outfile='DAR.V2.2012115.1.CSV'
testfile='totality_request.sql'
header_prefix='DATA FILE'
no_ext_file=`echo $outfile |sed 's/\(.*\)..../\1/'`
... (6 Replies)
I'm trying to extract a subject from a mail message but my subject example has 2 lines. How can I manage to extract it and write a string at the end of it?
Consider this example:
From: test@domain.com
Subject: Re: U =?ISO-8859-1?Q?qu=EA=3F!=3F!=3F!!_wtff_=E7=E3o_=ED=F3?=
... (6 Replies)
Hi,
I ran a script named cat item
when I searched for this script using command PS
I get two process . I don't understand this. Also this script has run for 15 minutes but the time is showing as 0:00:confused::confused:
ps -ef | grep cat_item
catmgr 4508 4486 0 05:10:29 ? 0:00... (5 Replies)
1. increase file space
first, double space a file:
awk '1;{print ""}'
I probably can understand it:print a blank line every time.But when I read triple space a file I am confused:
awk '1;{print "\n"}'
doesn't it meaning print a blank line every time too?
2. number each line of file, but... (6 Replies)
Discussion started by: hhdzhu
6 Replies
LEARN ABOUT BSD
syserrlst
SYSERRLST(3) Library Functions Manual SYSERRLST(3)NAME
syserrlst, __errlst - read system error messages from file
SYNOPSIS
char *
syserrlst(err)
int err;
char *
__errlst(err, path);
int err;
char *path;
DESCRIPTION Syserrlst(3) reads the error message string corresponding to err from the file /etc/syserrlst.
__errlst(3) reads the error message string corresponding to err from the file path. The file path must be in the format described in
syserrlst(5).
NULL is returned if err is out of bounds (negative or greater than the highest message number in /etc/syserrlst or path) or if the error
message file can not be opened. It is the responsibility of the caller (strerror(3)) to check for and properly handle the NULL return.
RETURN VALUE
NULL if an error was encountered in opening the error message file, if the error was out of bounds, or if the file did not start with the
correct magic number. Otherwise a char * is returned pointing to a static buffer containing the text of the error message.
ERRORS syserrlst(3) and __errlst(3) can return any of the errors for the open(2), lseek(2), or read(2) system calls.
SEE ALSO perror(3), strerror(3), syserrlst(5)HISTORY syserrlst(3), and __errlst(3) were created for 2.11BSD with the aim of saving 2kb of Data space in programs which called perror(3), or str-
error(3).
BUGS
The information is stored in a static buffer.
3rd Berkeley Distribution March 26, 1996 SYSERRLST(3)