Sponsored Content
Full Discussion: Duplicates to be removed
Top Forums Shell Programming and Scripting Duplicates to be removed Post 302213557 by vgersh99 on Thursday 10th of July 2008 11:36:56 AM
Old 07-10-2008
Quote:
Originally Posted by prvnrk
Thanks for your replies.

Vgersh - Your solution worked (as space is the delimiter). I'm sorry that i did not use "comma" in the example. Actually the delimiter is "comma" as mentioned in the post.

Please advise.

Prvn
use radoulov's code
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Will Old Files Be Removed

I have windows Xp installed, and decided to install Solaris Sun Unix 10. The hard disk was previousely partitioned into 5 partition. C: = Win98 D = WinXP and e,f,g,h are applications and so on. When istalling Sun Unix, will all the drives be removed, or I will specify where to install it. Thanks... (5 Replies)
Discussion started by: sunsation
5 Replies

2. Shell Programming and Scripting

directories are not getting removed

hello Everyone. I'm having the following problem: I have number of installation in the directory. each installation consists of executable file and directory. when I do the new installation I move old one to File_name-Time_stamp. this is done for executable and for directory. Everything is done... (6 Replies)
Discussion started by: slavam
6 Replies

3. UNIX for Dummies Questions & Answers

a way to tell what was removed after rm -rf ?

Hello all! I ran rm -rf on a wrong directory, noticed it and hit ctrl-c. Is there any way on a debian machine to tell what actually got deleted? As there were many dirs and files in this directory that I don't care for, I'd like to see if anything important was removed. Or do you know in... (4 Replies)
Discussion started by: thosch
4 Replies

4. UNIX for Advanced & Expert Users

Removed ^M from Libraries

I used the following to remove ^M in all files - I guess i did it in haste :mad: find / -name "*" | xargs perl -p -i -e 's/^M//g' * It changed all my LIBRABRIES since i used -- perl -p -i -e 's/^M//g' * Is there some way to revert this from my libraries . Does any revert command... (10 Replies)
Discussion started by: telecomics
10 Replies

5. AIX

Default route removed - what to do ?

Hi, After accidental default route removal serial connection doesn't work. What should I do to connect to my machine ? thanks Vilius (7 Replies)
Discussion started by: vilius
7 Replies

6. Shell Programming and Scripting

Removed Lines

Hi Guys, I am using SunOS 5.9 running Oracle Databases on it... I have log files that I suspect that some lines within the logs where removed. How do I tell if indeed some lines within a particular file where removed and by whom? Thanks in advance (2 Replies)
Discussion started by: Phuti
2 Replies

7. Linux

file removed

Hi Team, I have deleted a file accidentally by using rm command. I am not the root(admin) user. Can you please let me know how to get that .tex file? (2 Replies)
Discussion started by: darling
2 Replies

8. Shell Programming and Scripting

Merging few files into one, duplicates are removed

Hello, I have few file such as below: abc.txt def.txt ghi.txt jkl.txt n.txt I would like to merge all these files together into one file. At the same time, any duplicates will be removed. (5 Replies)
Discussion started by: alegnagrp
5 Replies
priv_str_to_set(3)					     Library Functions Manual						priv_str_to_set(3)

NAME
priv_str_to_set(), priv_set_to_str() - privilege name to set conversion function SYNOPSIS
Parameters priv_list The list of privilege names, passed as a string, separated by one or more characters from delimiter. It may also contain the compound privileges (basic, basicroot, and policy). delimiter Separates the privileges in priv_list. index_ptr If an error occurs while parsing the list of privilege names, the pointer pointed to by index_ptr is set to point to the remainder of the string after the error occurred, so long as index_ptr is not a NULL pointer. delimiter Separates the individual privilege names by any of the specified characters. If delimiter is a NULL character, the default delimiter of comma is used. flag Bit mask with the following bit positions defined: Exactly one of the two flags must be passed. When flag is the resulting string uses the compound privileges and to arrive at a short representation. priv_vec Specifies privilege set. DESCRIPTION
priv_str_to_set Conversion converts a list of privilege names to a privilege set. priv_list is a string consisting of privilege names and/or compound privileges. The individual elements in the string are separated by one or more characters of delimiter . Any privilege in the list priv_list can be optionally preceded by an exclamation mark to be interpreted as removal. For example, means all privileges in the compound privilege except the privilege. The string is case-insensitive. prefix is optional to a privilege name. For example, and all have the same meaning. priv_list is interpreted left to right, so the string is the same as an empty list of privileges, while is the same as For a list of valid privileges (both individual privileges and compound privileges), see privileges(5). priv_set_to_str Conversion converts a privilege set to a string of privilege names separated by the character specified by delimiter . RETURN VALUE
and return the following values: pointer Successful completions. Returns a non-null pointer. The caller of is responsible for freeing the result using the The caller of is responsible for freeing the result using the NULL pointer Function failed. Returns a null pointer and sets to indicate the error . ERRORS
If any of the following conditions occur, the functions fail and set Cannot allocate enough memory for the given data. One or more arguments are invalid. EXAMPLES
#include <stdio.h> #include <sys/types.h> #include <sys/privileges.h> #define priv_list "PRIV_CHOWN,PRIV_CHROOT,PRIV_DACREAD" main() { char *index; priv_set_t * priv_vector; if ( (priv_vector = priv_str_to_set( priv_list, NULL, &index)) == NULL ) { perror("priv_str_to_set Failed"); if (index) printf("Invalid privilege name starting at %s ", index); exit(1); } printf("The privileges in the given privilege vector are %s ", priv_set_to_str( priv_vector, NULL, PRIV_STR_SHORT) ); } DEPENDENCIES
and are both part of the library. SEE ALSO
privset_free(3), privileges(5). priv_str_to_set(3)
All times are GMT -4. The time now is 09:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy