Hello everyone!! Nice do be apart of your forum. I am not very good at unix and thats why i need your help i have this project where i have to simulate a grep command without using grep thought. I have to simulate
as a file i am using /etc/passwd
Moreover they will have to be able to use paremeters such as
re+
re?
re1|re2
where you find in an egrep.
i know the first 2 can be done with sed but i am not sure if the re+,re? and re1|re2 parameters work...
Please if someone clould help i would be gratefull.
Thanks a lot.
*ps forgot to mention the language we use in script writing is awk.
Last edited by Franklin52; 12-16-2009 at 04:25 AM..
Reason: Please use code tags!
Sure but i have olny made a menu to use these commands for simulation
This is the main file
The echos are in greek
The olny thing now is i will have to put 6 more files for the grep commands. As i said though they will have to be written differently and accept the above parameters.
Last edited by Franklin52; 12-16-2009 at 04:26 AM..
Reason: Please use code tags!
Can you give me one exaple so i can convert the others
for instance i know
question ... where do i put -r for extended regular expressions, next to the -n?
Yes, so it would be sed -rn but you have to check your man page is -r is supported, otherwise you have to use \ everywhere.
For examples have a look at another thread in which I just happened to have posted an example.
Within a shell script I use
uniq -w 16 -D
in order to process all lines in which the first 16 characters are duplicated.
Now I want to also run that script on a BSD based system where the included version of uniq does not support the -w (--check-chars) option. To get around this I have... (7 Replies)
All traffic on the LAN is routed through a single machine and filtered using iptables. I'd like to redirect this traffic to a transparent proxy running on the same machine that will rewrite the URL if it matches a specified regex, in which case the user will be redirected to a local server. In... (0 Replies)
Hi
I have an input file which have random file in between.I have to manipulate each line and replace the character from position 5-10 with XXXXXX.
But when I am writing this to on output file the tabs in between gets converted to normal space.
Input file :
14207531131040896334R108 ... (4 Replies)
I'm trying to make this work with a variety of different sendmail versions (all 8.8 or better) and different OS's.
I have to configure all my unix workstations to deliver all email through a relay 'smtp.mydomain.com'. This includes unqualified names as well as qualified names and remote... (1 Reply)
Hi,
I have a postfix server that relays to an exchange server. All of my unix/linux systems send to this server, the problem is the form the mail is sent with,
the sender address is
username@hostname.domain.local
I need to rewrite every sender address to
unix@maildomain.com
for... (0 Replies)
Hello I'm curious about how to get a bash script to rewrite a line of standard output. For example, many programs track their progress by writing percentages on the screen:
Precent Done: 60%
That line gets updated periodically to reflect the status.. My question, is how do we do this, as... (5 Replies)
Hi!
I'm a beginner at scripting, but have managed to complete a working KSH-script.. :D
But since this is going to production i a few weeks, I would like to optimize it and make it better structured!
The idéa of the script is to collect data from the database, put it in a file, and then... (2 Replies)
I am using:
..to get the word that is being searched. What I am looking to do,
is to rewrite the word and us it in css:
Sort of like this javascript:
Hopefully I am making myself clear.
Any ideas how I could do this? (1 Reply)
I have an architecture as below
<> <>
There is a program in the AIX server which sends SMS to the internet, by sending HTTP request to the SMS processing server.
Like, http://smsserver/mysms=test
However the application does not have an option to specify where the Proxy server... (1 Reply)