| | |
awk question
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi Guys,
I am using a BASH script to add users to an ACL in the squid.conf file. Basically the script searches for a string and adds a variable to the end of the string like this:
Now the problem is that there is more than one occurrence of the search string (INTERNET in this case). I want awk to stop after the first successful operation.
At the moment it is adding the user to the ACL and again where it finds 'INTERNET' in the http_access directive.
Thanks
I am using a BASH script to add users to an ACL in the squid.conf file. Basically the script searches for a string and adds a variable to the end of the string like this:
Shell Scripting Syntax (Toggle Plain Text)
cat /etc/squid/squid.conf | awk "/INTERNET/{ $0=$0 " $UNAME" } {print} " > /tmp/sq.conf mv /tmp/sq.conf /etc/squid/squid.conf
At the moment it is adding the user to the ACL and again where it finds 'INTERNET' in the http_access directive.
Thanks
![]() |
Similar Threads
- C command-line I/O question (C++)
- Shell Scripting problem and related awk issues (Shell Scripting)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the Shell Scripting Forum
- Previous Thread: Swaping Files
- Next Thread: What does @ mean???
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting





