Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How can I remove partial duplicates and manipulate text? Post 303010393 by tara123 on Saturday 30th of December 2017 07:07:13 PM
Old 12-30-2017
this did not work.

Code:
perl -lpe 's/\s\K\S+/join ",", grep {!$seen{$_}++} split ",", $&/e'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed to manipulate text in files

Hi, I have a slight problem in trying to manipulate the text within a file using the "sed" command in that the text i need changed has "/" slashes in. I have a .sh script that scans the "/db/sybbackup/" directories for any .dmp file older than 2 days and then to >> the information to a file called... (3 Replies)
Discussion started by: Jefferson333
3 Replies

2. Shell Programming and Scripting

Script to manipulate logfile text

Hi guys, I was wandering if a Shell guru could give me some advice on tackling a problem. I have used a mixture of grep, cut and awk to get data from a log file in the following format: 14/11/08 10:39: Checking currenly : Enabled 14/11/08 10:39: Records allocated : 221... (11 Replies)
Discussion started by: rosspaddock
11 Replies

3. Shell Programming and Scripting

Remove duplicates

Hello Experts, I have two files named old and new. Below are my example files. I need to compare and print the records that only exist in my new file. I tried the below awk script, this script works perfectly well if the records have exact match, the issue I have is my old file has got extra... (4 Replies)
Discussion started by: forumthreads
4 Replies

4. Shell Programming and Scripting

Remove the partial duplicates by checking the length of a field

Hi Folks - I'm quite new to awk and didn't come across such issues before. The problem statement is that, I've a file with duplicate records in 3rd and 4th fields. The sample is as below: aaaaaa|a12|45|56 abbbbaaa|a12|45|56 bbaabb|b1|51|45 bbbbbabbb|b2|51|45 aaabbbaaaa|a11|45|56 ... (3 Replies)
Discussion started by: asyed
3 Replies

5. Shell Programming and Scripting

sed to remove partial text in one line only

I have test.xml XML file like <Report account="123456" start_time="2014-09-08T00:00:00+00:00" end_time="2014-09-10T23:59:59+00:00" user="Dollar Tree" limit="1000000" more_sessions="some text "> <Session ......rest of xml............... I need output like <Report> <Session ......rest of... (3 Replies)
Discussion started by: kumars1331@gmai
3 Replies

6. Shell Programming and Scripting

Manipulate the text file in UNIX

Hi All, I have a file like below and i have 2 questions on this (They are 3 lines starts with 01 , 02 and 03. but is 01abc333644554 234 2334535 34534535355353 sfsdf345455 353 4543 jgkg tty 7676 02cdesdfsdfsdf 234 wesdfsdf 345345 234234 234234 2342342 dfgdfg sdfgg dgdgdg fgvfs... (6 Replies)
Discussion started by: siva.pitchai
6 Replies

7. Shell Programming and Scripting

Match partial text

I posted the incorrect files yesterday and apologize. I also modified the awk script but with no luck. There are two text files in the zip (name.txt and output.txt). I am trying to match $2 in name.txt with $1 in output.txt and if they match then $1 of name.txt is copied to $7 of output.txt. ... (7 Replies)
Discussion started by: cmccabe
7 Replies

8. Shell Programming and Scripting

Remove duplicates

Hi I have a below file structure. 200,1245,E1,1,E1,,7611068,KWH,30, ,,,,,,,, 200,1245,E1,1,E1,,7611070,KWH,30, ,,,,,,,, 300,20140223,0.001,0.001,0.001,0.001,0.001 300,20140224,0.001,0.001,0.001,0.001,0.001 300,20140225,0.001,0.001,0.001,0.001,0.001 300,20140226,0.001,0.001,0.001,0.001,0.001... (1 Reply)
Discussion started by: tejashavele
1 Replies

9. Shell Programming and Scripting

Script to compare partial filenames in two folders and delete duplicates

Background: I use a TV tuner card to capture OTA video files (.mpeg) and then my Plex Media Server automatically optimizes the files (transcodes for better playback) and places them in a new directory. I have another Plex Library pointing to the new location for the optimized .mp4 files. This... (2 Replies)
Discussion started by: shaky
2 Replies

10. Shell Programming and Scripting

A better way to manipulate text

Good morning everyone, I'm currently trying to convert an environment variable into a string and then attach it at the end of a command and launch it. I have the following right now, but it's very ugly: AMI_TAGS="env=test,country=XX,city=blah,galaxy=blahblah" aws ec2 create-tags... (8 Replies)
Discussion started by: da1
8 Replies
LOGPROF.CONF(5)                                                      AppArmor                                                      LOGPROF.CONF(5)

NAME
logprof.conf - configuration file for expert options that modify the behavior of the AppArmor aa-logprof(1) program. DESCRIPTION
The aa-logprof(1) program can be configured to have certain default behavior by the contents of logprof.conf. The [qualifiers] section lists specific programs that should have a subset of the full ix/px/ux list when asking what mode to execute it using. Since creating a separate profile for /bin/bash is dangerous, we can specify that for /bin/bash, only (I)nherit, (U)nconstrained, and (D)eny should be allowed options and only those will show up in the prompt when we're asking about adding that to a profile. Likewise, if someone currently exec's /bin/mount in ix or px mode, things won't work, so we can provide only (U)nconstrained and (D)eny as options. And certain apps like grep, awk, sed, cp, and mkdir should always inherit the parent profile rather than having their own profile or running unconfined, so for them we can specify that only (I)nherit and (D)eny are the allowed options. Any programs that are not listed in the qualifiers section get the full (I)nherit / (P)rofile / (U)nconstrained / (D)eny option set. If the user is doing something tricky and wants different behavior, they can tweak or remove the corresponding line in the conf file. The [defaulthat] section lists changehat-aware programs and what hat aa-logprof(1) will collapse the entries to for that program if the user specifies that the access should be allowed, but should not have it's own hat. The [globs] section allows modification of the logprof rule engine with respect to globbing suggestions that the user will be prompted with. The format of each line is-- "<perl glob> = <apparmor glob>". When aa-logprof(1) asks about a specific path, if the perl glob matches the path, it replaces the part of the path that matched with the corresponding apparmor glob and adds it to the list of globbing suggestions. Lines starting with # are comments and are ignored. EXAMPLE
[qualifiers] # things will very likely be painfully broken if bash has it's own profile /bin/bash = iu # mount doesn't work if it's confined /bin/mount = u # these helper utilities should inherit the parent profile and # shouldn't have their own profiles /bin/awk = i /bin/grep = i /bin/sed = i [defaulthat] /usr/sbin/sshd = EXEC /usr/sbin/httpd2 = DEFAULT_URI /usr/sbin/httpd2-prefork = DEFAULT_URI [globs] # /foo/bar/lib/libbaz.so -> /foo/bar/lib/lib* /lib/lib[^/]+so[^/]*$ = /lib/lib*so* # strip kernel version numbers from kernel module accesses ^/lib/modules/[^/]+/ = /lib/modules/*/ # strip pid numbers from /proc accesses ^/proc/d+/ = /proc/*/ BUGS
If you find any bugs, please report them at <http://https://bugs.launchpad.net/apparmor/+filebug>. SEE ALSO
apparmor(7), apparmor.d(5), aa-enforce(1), aa-complain(1), aa-disable(1), aa_change_hat(2), aa-logprof(1), aa-genprof(1), and <http://wiki.apparmor.net>. AppArmor 2.7.103 2012-06-28 LOGPROF.CONF(5)
All times are GMT -4. The time now is 01:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy