given an input file containing fields seperated by "," how do I retrieve information of these fields, do some work on them, then create a new input to the etc/passwd file?
someone told me to look at the "sed" command but I still cant seem to get over this problem. I want to work on the data so... (8 Replies)
I had a drive go bad. I have replaced the drive and have my system up. I have a 1-to-1 mirror raid. My mirrored boot drive brings the system up. I issued a reboot command. The system comes up gives me a login prompt and generates the error: failed write of utmpx entry:"i2".
What is i2? (1 Reply)
Hi,
I am working on a UNIX AIX system and all the entries in /etc/passwd file are in the following format..
root:!:0:0::/:/usr/bin/ksh
I have an idea abt each field, but I am confused abt the values in the second field.
If the value of the second filed is 'x' then it means the password... (2 Replies)
I am using the standard vixie-cron am seeing the following my logs : crond: (username) ORPHAN (no passwd entry) Ordinarily this is a simple matter, there is no corresponding user, but I am using central authentication and the username does exist and is usable via the standard nsswitch mechanism, so... (2 Replies)
I could not find an entry for my linux user account in /etc/passwd file. I can remember some time back one of my SA showed the entry line using some other command. Can someone please help me on this to view the details of my linux user account? (3 Replies)
Hi Folks,
I have Solaris 10, latest release.
We have passwd aging set in /etc/defalut/passwd.
I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging.
When I reset the users passwd using passwd command, it re enables... (3 Replies)
Hi
root user creates a user using the useradd command. This command creates an entry in the /etc/passwd file. /etc/passwd file has rw permission for the root user. Now, if I happen to remove the w permission for the root user, useradd command still is successfully creating entry in the... (3 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 All,
Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries.
example:
Parent is :
----------
dn: email=yogesh.kumar@wipro.com, o=wipro, o=in
child is:
----------
dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
did a big mistake, changing root entry of /etc/passwd to
root:x:0:0:root:/root:/usr/bin/tmux split-window -v \; attach
as expected, now I can't login as root anymore. sudo ed /etc/passwd etc. doesn't work.
Any idea?
Use code tags to increase readability and follow the rules. (4 Replies)
Discussion started by: dodona
4 Replies
LEARN ABOUT NETBSD
fsetpos
FSEEK(3) BSD Library Functions Manual FSEEK(3)NAME
fgetpos, fseek, fseeko, fsetpos, ftell, ftello, rewind -- reposition a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
int
fseek(FILE *stream, long int offset, int whence);
int
fseeko(FILE *stream, off_t offset, int whence);
long int
ftell(FILE *stream);
off_t
ftello(FILE *stream);
void
rewind(FILE *stream);
int
fgetpos(FILE * restrict stream, fpos_t * restrict pos);
int
fsetpos(FILE * restrict stream, const fpos_t * restrict pos);
DESCRIPTION
The fseek() function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained
by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to
the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek() function clears the
end-of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream.
The fseeko() function is identical to the fseek() function except that the offset argument is of type off_t.
The ftell() function obtains the current value of the file position indicator for the stream pointed to by stream.
The ftello() function is identical to the ftell() function except that the return value is of type off_t.
The rewind() function sets the file position indicator for the stream pointed to by stream to the beginning of the file. It is equivalent
to:
(void)fseek(stream, 0L, SEEK_SET)
except that the error indicator for the stream is also cleared (see clearerr(3)).
In this implementations, an ``fpos_t'' object is a complex object that represents both the position and the parse state of the stream making
these routines are the only way to portably reposition a text stream. The pos argument of fsetpos() must always be initialized by a call to
fgetpos().
RETURN VALUES
The rewind() function returns no value. Upon successful completion, fgetpos(), fseek(), fseeko(), and fsetpos() return 0. The functions
ftell() and ftello() return the current offset. Otherwise, fseek(), fseeko(), ftell(), and ftello() return -1 while fgetpos() and fsetpos()
return a nonzero value. On error all functions the global variable errno is set to indicate the error. Since the rewind() function does not
return an error code, applications need to clear errno before calling it in order to detect errors.
ERRORS
[EBADF] The stream specified is not a seekable stream.
[EINVAL] The whence argument to fseek() was not SEEK_SET, SEEK_END, or SEEK_CUR.
[EOVERFLOW] For ftell(), the current file offset cannot be represented correctly in an object of type long.
The function fgetpos(), fseek(), fseeko(), fsetpos(), ftell(), ftello(), and rewind() may also fail and set errno for any of the errors spec-
ified for the routines fflush(3), fstat(2), lseek(2), and malloc(3).
SEE ALSO lseek(2)STANDARDS
The fgetpos(), fsetpos(), fseek(), ftell(), and rewind() functions conform to ANSI X3.159-1989 (``ANSI C89''). The fseeko() and ftello()
functions conform to X/Open System Interfaces and Headers Issue 5 (``XSH5'').
BUGS
The fgetpos() and fsetpos() functions don't store/set shift states of the stream in this implementation.
BSD January 21, 2012 BSD