Hello all
Im performing find + grep operation that looks like this :
find . -name "*.dsp" | xargs grep -on Project.lib | grep -v ':0'
and I like to add to this one liner the possibility to replace the string " Project.lib" that found ( more then once in file ) with "Example.lib"
how can I do... (0 Replies)
how to use sed command to find and replace a directory
i have a file.. which contains lot of paths ...
for eg.. file contains..
/usr/kk/rr/12345/1
/usr/kk/rr/12345/2
/usr/kk/rr/12345/3
/usr/kk/rr/12345/4
/usr/kk/rr/12345/5
/usr/kk/rr/12345/6
/usr/kk/rr/12345/7... (1 Reply)
Hi all,
I know this question has probably been answered before, but I am struggling with this problem, even after googling a million pages.
In a file named rdmt.conf
I need a single character replaced, the number in the line below
CUR_OC4J_ID=1
It will always appear after... (3 Replies)
Hi Everyone,
I am new to this forum and new to sed/awk programming too !!
I need to find particular string in file1(text file) and replace it with a value from another text file(file2) the file2 has only one line and the value to be replaced with is in the second column.
file 1:
(assert (=... (21 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Grep and Sed (replace string in patterned lines)
Hi all,
I want to grep for "PATTERN" and only if "PATTERN" is in a line, this line shall be used as replacement input e.g. for SED.
I don't get it running in one line.
NOT RUNNING - just first idea... I don't know how to redirect grep... (2 Replies)
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)
how to search and replace string in column in file with command sed or other
search "INC0000003.in" and replace column 4 = "W"
$ cat file.txt
INC0000001.in|20150120|Y|N|N
INC0000002.in|20150120|Y|N|N
INC0000003.in|20150120|Y|N|N
INC0000004.in|20150120|Y|N|Noutput... (4 Replies)
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
LEARN ABOUT OSX
mbr_check_service_membership
MBR_CHECK_MEMBERSHIP(3) BSD Library Functions Manual MBR_CHECK_MEMBERSHIP(3)NAME
mbr_check_membership, mbr_check_service_membership -- check whether a user is a member of a group or service ACL
SYNOPSIS
#include <membership.h>
int
mbr_check_membership(uuid_t user, uuid_t group, int *ismember);
int
mbr_check_service_membership(uuid_t user, const char *service, int *ismember);
DESCRIPTION
mbr_check_membership() tests if a given user is a member of a group (either direct or indirect via a nested group). ismember is set to 1 if
the user is a member or 0 if not a member of the group. mbr_check_service_membership() similarly tests if a given user is a member of a ser-
vice ACL group. Service ACLs are special groups defined with the prefix "com.apple.access_". The service is then prefixed (e.g., "afp"
would check "com.apple.access_afp"). There is a special group that grants accessto all services called "com.apple.access_all_services".
Users may belong to any number of groups. mbr_check_membership() should always be used to check group membership, rather than calling
getgroups(2) or getgrouplist(2). The setgroups(2) and getgroups(2) routines are limited to a fixed number of gids, and so may not include
all of a user's groups.
There are two special cases. If the two uuids are equal, then ismember is set to 1. If the group uuid is equal to the reserved "everyone"
uuid (ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C), then ismember will be set to 1 for any valid user.
Group membership information is managed by opendirectoryd(8).
RETURN VALUES
mbr_check_membership() does not test whether group exists or not. Querying membership for a nonexistent group will result in ismember being
set to 0. The function returns 0 on success or one of the following error codes on failure:
[EIO] Communication with openditectoryd(8) failed.
[ENOENT] user can not be found.
mbr_check_service_membership() is identical to mbr_check_membership() except that ENOENT means no service ACL has been defined.
SEE ALSO odutil(1), setgroups(2), getgroups(2), mbr_uid_to_uuid(3), opendirectoryd(8)Mac OS X November 5, 2011 Mac OS X