Sponsored Content
Top Forums Shell Programming and Scripting Help with grep (reWriting it in another way.) Post 302380688 by kenshin88 on Wednesday 16th of December 2009 03:13:22 AM
Old 12-16-2009
Sure but i have olny made a menu to use these commands for simulation
This is the main file

Code:
#!/bin/sh
echo "

----------------------------------------------------------------------
"
while true;do
echo -n "           << Grep Simulation Script >>

----------------------------------------------------------------------

                   1.(n) Grep -n
                   2.(v) Grep -v
                   3.(y) Grep -y
                   4.(i) Grep -i 
                   5.(w) Grep -w
                   6.(f) Grep -f
                   7. (E)xit

             Doste epilogi gia prosomoiosi:   (Give your choise for sim)"
read epilogi
case $epilogi in
1|n|N)./grep-n;;
2|v|V)./grep-v;;
3|y|Y)./grep-y;;
4|i|I)./grep-i;;
5|w|W)./grep-w;;
6|f|F)./grep-f;;
7|e|E) exit 0;; 
*)echo " 

       !!!<< Dosate lathos epilogi, dokimaste ksana(wrong choise, try again, >>!!!
----------------------------------------------------------------------
";;
esac
done

The echos are in greek Smilie



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!
 

9 More Discussions You Might Find Interesting

1. IP Networking

Squid Proxy URL rewriting

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)
Discussion started by: firdousamir
1 Replies

2. UNIX for Dummies Questions & Answers

Rewriting a word from location

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)
Discussion started by: marringi
1 Replies

3. Shell Programming and Scripting

Help rewriting my KSH-script...

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)
Discussion started by: linsto
2 Replies

4. Shell Programming and Scripting

Rewriting standard output lines

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)
Discussion started by: neked
5 Replies

5. UNIX for Advanced & Expert Users

postfix sender address rewriting

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)
Discussion started by: funksen
0 Replies

6. UNIX and Linux Applications

sendmail recipient address rewriting with local_relay or mail_hub

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)
Discussion started by: icefalcon
1 Replies

7. UNIX for Dummies Questions & Answers

Rewriting line with tabs creating problem

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)
Discussion started by: akashtcs
4 Replies

8. IP Networking

Transparent Proxy with URL Rewriting

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)
Discussion started by: crottyan
0 Replies

9. Shell Programming and Scripting

Rewriting GNU uniq in awk

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)
Discussion started by: mij
7 Replies
GREP(1) 						      General Commands Manual							   GREP(1)

NAME
grep - search a file for lines containing a given pattern SYNOPSIS
grep [-elnsv] pattern [file] ... OPTIONS
-e -e pattern is the same as pattern -c Print a count of lines matched -i Ignore case -l Print file names, no lines -n Print line numbers -s Status only, no printed output -v Select lines that do not match EXAMPLES
grep mouse file # Find lines in file containing mouse grep [0-9] file # Print lines containing a digit DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1 occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is returned. SEE ALSO
cgrep(1), fgrep(1), sed(1), awk(9). GREP(1)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy