Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Calling all the awk gurus out there. Post 302782641 by savigabi on Tuesday 19th of March 2013 08:52:08 AM
Old 03-19-2013
Quote:
Originally Posted by Scrutinizer
How about sed:
Code:
$ sed -e :a -e 's/\(.*\) \([a-z_]\{1,\}=\)/\1;\2/;ta' file
User1;id=11111;gecos=John Doe;groups=group1, group2;account_locked=false

Or just the values with awk:
Code:
$ awk -F' *[a-z_]+=' '{$1=$1}1' OFS=';'  file
User1;11111;John Doe;group1, group2;false

Awesome, thank you so much Scrutinizer, that works perfectly! I will now know next time how to do this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with shell script - Unix Gurus calling

Unix Gurus, I have been breaking my head to get this done..seems simple.. I need to read a flat file and based on a key word in a line, i need to skip the previous 3 lines. eg : Line1 Line2 Line3 Line4 Line5 Line6 Error Line7 Line8 Line9 Error Line10 (4 Replies)
Discussion started by: ravred
4 Replies

2. Shell Programming and Scripting

Calling ipcrm from awk

Hello, With next simple command line I get all allocated semaphore numbers: ipcs -s | awk 'NR > 3 {print $2}' Now I want to add ipcrm -s before each semaphore id and actually delete every last of them. The question is: Can I do the operation in a command itself, without redirecting awk... (2 Replies)
Discussion started by: BaruchLi
2 Replies

3. Solaris

calling script from awk

Hi, I'm not sure, there is solution exist for this problem. I'm facing problem in calling a unix script from awk code. Here is code nawk -F'=' ' BEGIN { } function runtest(string) { LINE } /^/ { # getting module name t=$1 module=substr(t,2,(length(t)-2)) runtest(module) }... (1 Reply)
Discussion started by: luckybalaji
1 Replies

4. Shell Programming and Scripting

calling mysql gurus : need help with my view

hi there I have a view which is working fine, but i have been told that i need to make sure the resulting output excludes all rows with nic_status equal to the string "removed". Does anybody know in which part of the code below i would place the conditional ... WHERE nic_status !=... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

5. Shell Programming and Scripting

calling a method inside awk

Hi All, How do we call a method existing in another file inside awk. After matching a pattern i want to call a method secureCopy that exists in another file, but method not getting called: ls -l | awk -v var2=$servername -v var1=$srcserverpath -v var3=$tgtpath '... (1 Reply)
Discussion started by: abhinav192
1 Replies

6. Shell Programming and Scripting

Calling of search using awk

Database rina lives:fatin:20:20:20 rina:fatin:20:20:20 i am having a small problem in extracting out the information from the database. For example, if i were to input a book titled rina into my search , i would only want it to display the row which has the title rina, like this ... (4 Replies)
Discussion started by: gregarion
4 Replies

7. Shell Programming and Scripting

Calling awk from csh

I am trying to call awk from a csh script using awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv and getting awk: Command not found. Running awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv on the command line with the actual filenames works (2 Replies)
Discussion started by: kristinu
2 Replies

8. Shell Programming and Scripting

Calling awk fom csh

I have to call two awk scripts where the second one used the output from the first one. Am wondering if it may happen that the second awk might start before the first awk finished creating the file... if ($nAnomaly == 1) then awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz \ ... (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

calling awk from php not working

I want to run awk from php to do some text processing. I am giving an extremely simple example below: onecol.awk file ------------------- { print "Hello!"; } f1.txt --------- aaa ccc eee f2.txt --------- (6 Replies)
Discussion started by: mary271
6 Replies

10. Shell Programming and Scripting

Calling array inside awk

Hello I have the file df.tmp FS is actually the / FS but escape character\ and end of line $ is used in order to fetch exctly / and not other filesystems. awk '/\/$/ {print $(NF-1)+0}' df.tmp will work properly and return a value eg. 60 but when I am trying to issue the command with the array... (3 Replies)
Discussion started by: drbiloukos
3 Replies
squid_unix_group(8)					      System Manager's Manual					       squid_unix_group(8)

NAME
squid_unix_group - Squid UNIX Group external_acl helper SYNOPSIS
squid_unix_group [-g groupname] [-g groupname...] [-p] DESCRIPTION
This helper allows Squid to base access controls on users memberships in UNIX groups. -g groupname Specifies a group name to match. -p Also match the users primary group from /etc/passwd EXAMPLES
This squid.conf example defines two Squid acls. usergroup1 matches users in group1, and usergroup2 matches users in group2 or group3 external_acl_type unix_group %LOGIN /usr/local/squid/libexec/squid_unix_group -p acl usergroup1 external unix_group group1 acl usergroup2 external unix_group group2 group3 NOTES
By default up to 11 groups can be matched in one acl (including commandline specified groups). This limit is defined by MAX_GROUPS in the source code. AUTHOR
This manual page was written by Henrik Nordstrom <hno@squid-cache.org> squid_unix_group is written by Rodrigo Campos <rodrigo@geekbunker.org> KNOWN ISSUES
Does not understand gid aliased groups sometimes used to work around groups size limitations. If you are using gid aliased groups then you must specify each alias by name. QUESTIONS
Any questions on usage can be sent to Squid Users <squid-users@squid-cache.org> REPORTING BUGS
Report bugs or bug-fixes to Rodrigo Campos <rodrigo@geekbunker.org> or Squid Developers <squid-dev@squid-cache.org> SEE ALSO
group(5),passwd(5) Squid UNIX Group helper 12 August 2002 squid_unix_group(8)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy