Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Find and replace till nth occurence of a special character Post 302803157 by satyaatcgi on Monday 6th of May 2013 03:57:29 AM
Old 05-06-2013
Thanks for the quick response. Its working fine.

Cheers,
Satya..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Replace nth character in a file with a period

Hi all, If you look at the example below,I want to replace the 21st character (,) with a period (.). I have 1000 records in a file can someone help me how to do that. Thankyou all in advance. "2008-07-15... (3 Replies)
Discussion started by: blackhawk_123
3 Replies

2. Shell Programming and Scripting

Find index of last occurence of a character within a string

I need to find the index of last '|' (highlighted in bold) in awk : |ifOraDatabase.Lastservererr<>0then|iferr_flag<>0then|end if Please suggest a way... Thanks (5 Replies)
Discussion started by: joyan321
5 Replies

3. Shell Programming and Scripting

Replace matching nth occurence

Hi for eg my file has: val1 | val2 | val1 | val2 | val1 | val2 | val1 | val2 | here i need to replace '|' with '|\n' where the occurence of '|' is divisble by 2 so that the output comes like this val1 | val2 | val1 | val2 | val1 | val2 | val1 | val2 | Requesting suggestions in... (1 Reply)
Discussion started by: raghav288
1 Replies

4. UNIX for Dummies Questions & Answers

To find the Nth Occurence of Search String

Hi guys, I like to find the Line number of Nth Occurence of a Search string in a file. If possible, if it will land the cursor to that particualar line will be great. Cheers!! (3 Replies)
Discussion started by: mac4rfree
3 Replies

5. Emergency UNIX and Linux Support

Replace nth position character of all the lines in file

I want to replace 150th character of all the lines in a file using sed or awk... searched the forums but didn't find exact answer (9 Replies)
Discussion started by: greenworld123
9 Replies

6. Shell Programming and Scripting

replace /n with special character

I would like to replace /n with ',' and after replace remove last semicolon then put a open brace in starting and closing brace in end of line. See below example: input: 1234 3455 24334 234 output: ('1234,'3455',24334','234') Thanks (3 Replies)
Discussion started by: anupdas
3 Replies

7. Shell Programming and Scripting

To find nth position of character in string

Hi guyz i want to know nth position of character in string. For ex. var="UK,TK,HK,IND,AUS" now if we see 1st occurance of , is at 3 position, 2nd at 6,..4th at 13 position. 1st position we can find through INDEX, but what about 2nd,3rd and 4th or may be upto nth position. ? In oracle we had... (2 Replies)
Discussion started by: Jonty Immortal
2 Replies

8. Shell Programming and Scripting

awk script to replace nth character with comma

I have a requirement as below. In one of my column, I have data which may or may not be separted with coma always. Now I need to validate the length of these text within the coma (if available) and if the length is more than 30 characters, I need to insert a coma either at 30 characters if its... (3 Replies)
Discussion started by: aramacha
3 Replies

9. Shell Programming and Scripting

awk - find first occurence and replace it

Hello, I have a requirement to replace the whole string with first occurence of value of a key-value pair. I have to do this inside awk, as the data I need to work is inside an awk loop. value of my variable(say LogText) looks like: LogText= date=04Mar message=hello1 name=caq... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

10. Shell Programming and Scripting

Replace nth to nth character?

Hi I got the following problem and I wonder if some could please help me out? I'd like to replace character 8 - 16 , 16 - 24 cat file ... (2 Replies)
Discussion started by: stinkefisch
2 Replies
ffproxy.quick(7)				       BSD Miscellaneous Information Manual					  ffproxy.quick(7)

NAME
ffproxy.quick -- filtering HTTP/HTTPS proxy server quick introduction DESCRIPTION
ffproxy is a filtering HTTP/HTTPS proxy server. It is able to filter by host, URL, and header. Custom header entries can be filtered and added. It can even drop its privileges and optionally chroot(2) to some directory. Logging to syslog(3) is supported, as is using another auxiliary proxy server. An HTTP accelerator feature (acting as a front-end to an HTTP server) is included. Contacting IPv6 servers as well as binding to IPv6 is supported and allows transparent IPv6 over IPv4 browsing (and vice versa). This manual describes how to set up a basic HTTP proxy installation. It is assumed that you already have compiled the program or installed it via port or package. COPYING FILES
The program comes with default configuration files that contain both examples and suggested entries. You can simply copy them to a directory of your choice. This directory will become the program's working directory. mkdir /var/ffproxy tar cf - db/ html/ | ( cd /var/ffproxy ; tar xf - ) cp sample.config /var/ffproxy/ffproxy.conf Above example would install all needed files to /var/ffproxy, which is ffproxy's default working directory. SECURING
The proxy now has its own working directory. By default, ffproxy does not change UID/GID after start. For security reasons we want to enable it. You have two choices know: Either use existing UID/GID or add custom UID/GID for ffproxy. See adduser(8) or useradd(8), depend- ing on your system, on how to create new IDs. Edit ffproxy.conf and change the lines containing uid and gid # change UID and GID # # to use, both uid and gid must be set # (disabled by default) #uid proxy #gid proxy uid _ffproxy gid _ffproxy In addition to changing UID and GID, ffproxy should be executed change-rooted to its working directory. So we change chroot_dir and db_files_path in the configuration file # change root to (only in connection with uid and gid change) # (disabled by default) chroot_dir /var/ffproxy # path to db/ and html/ directories # (default: /var/ffproxy) db_files_path . db_files_path must be changed, too, since that is relative to new root. Finally, we copy /etc/resolv.conf to ffproxy's home to enable DNS in chroot and chown /var/ffproxy so the proxy's master process can write its PID file mkdir /var/ffproxy/etc cp /etc/resolv.conf /var/ffproxy/etc/ chmod 750 /var/ffproxy chown _ffproxy._ffproxy /var/ffproxy ACCESS TO THE PROXY
By default, nobody is allowed to connect to ffproxy. Let's say, we want to provide LAN users a filtering proxy to shut down malicous content coming from the Internet. So the proxy has to be listening on the local network interface only. We change bind_ipv4 and bind_ipv6 appropi- ately in ffproxy.conf bind_ipv4 martyr.burden.eu.org bind_ipv6 martyr.burden.eu.org Additionally, we have to change db/access.ip. By, for example, ^192.168.10. we allow 192.168.10.0/24 to use our proxy. STARTING THE PROXY
Last step is starting ffproxy. Keep in mind that we run the program change-rooted to /var/ffproxy, so files are relative to new root. cd /var/ffproxy ; /usr/local/bin/ffproxy -f ffproxy.conf starts ffproxy. Now test if it works correctly. If not, change ffproxy.conf and/or read ffproxy(8) ffproxy.conf(5) ffproxy is not running as daemon right know. If everything seems to work, simply shut down the proxy by pressing CTRL-C, set `daemonize yes' in the configuration file and start ffproxy again. TRANSPARENT OPERATION
The proxy allows transparent operation, that is, HTTP traffic is redirect to the proxy which simulates a HTTP server so that the users don't have to specify a proxy server. Consider forced usage of a proxy server as well. To do that, you will have to configure your NAT accord- ingly. On OpenBSD you'll want a line like rdr on rl0 proto tcp from any to any port 80 -> 127.0.0.1 port 8080 in /etc/pf.conf. See your NAT's documentation for details on how to do this. VERSION
This manual documents ffproxy 1.6 (2005-01-05). SEE ALSO
ffproxy(8), ffproxy.conf(5), pf.conf(5) Jan 5, 2005
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy