Hello guys,
Here i am writing a script in bash to check for a valid URL from a file using regex
This is my input file
#my script
What my output is:
here it is trimming the htttp://www.yahoo.commmmmm
Help me out from this
having a look on the regex site I saw that characters can be search using hex values
http://www.regular-expressions.info/characters.html
So I try to use it whith grep to find a è on a string (octal Decimal Hexa : 350 232 E8) but it doesn't work
E.g.
/usr/bin/echo '\0350' | egrep '\xE8'
... (0 Replies)
Hi,
I am trying to do something with grep, but for some reason I just can't get it to to work.
I am looking for find a match in the second field, the length must be 10 characters and end with 'abc'.
The file is in this format:
<int><tab><field2>
I've tried a few patterns, some work,... (2 Replies)
Hello everybody,
I'd like to know how is it I should write a regex in unix to match a string not followed by another string (anywhere in the line).
To be more specific, I want to find lines where "drop table" is found, but not followed anywhere in the line by the character "&".
For... (3 Replies)
Hi all,
I'm a beginner with linux, regex, grep, etc
I am trying to get data out of a file that has about 13,000 lines in this format
name - location
I want to grep all the names out to one file and the locations to another so I can put them into a spreadsheet.
Some have hyphenated... (14 Replies)
basically i have a csv i parse through. a user will supply me with a san switch he/she wants more info about... say the name is "pnj-sansw124"
now i can grep out every connection to that switch w/o issue because this sans switch pnj-sansw124 has multiple slots 1-10. and it looks like this in the... (5 Replies)
I want it to find lines that contain any number of capital letters before P
this is what I have tried
echo "AAAAAP" | grep 'P'
echo "AAAAAP" | grep '\{1\}P'
echo "AAAAAP" | grep '^*P'
But none of them seem to work, any help is much appreciated
thanks
Calypso (4 Replies)
Hello,
I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide.
ls -aLl /bin | grep "\(x\)"
Which works, just highlights 'x' where ever, when ever.
I'm trying to to get (?:) to work but... (4 Replies)
Hi to you all,
I'm just struggling with a regex problem and I'm pretty sure that I'm missing sth obvious... :confused:
I need a regex to feed my grep in order to find lines that contain one string but not the other.
Here's the data example:
2015-04-08 19:04:55,926|xxxxxxxxxx| ... (11 Replies)
Hi everyone,
I'm looking for a grep command to match the following pattern from a file:
<EGS>10234567<EGS>
I used this following command to do this:
grep -E '^<EGS>{8}<EGS>' test.txt
In output I got:
<EGS>10234567<EGS>
Till now it work, but if I add something at the end of the line... (2 Replies)
Discussion started by: Arnaudh78
2 Replies
LEARN ABOUT DEBIAN
httest
HTTEST(1) User Commands HTTEST(1)NAME
httest - test HTTP driven application
SYNOPSIS
httest [OPTIONS] scripts
DESCRIPTION
httest is a script based tool for testing and benchmarking web applications, web servers, proxy servers and web browsers. httest can emu-
late clients and servers in the same test script, very useful for testing proxys.
OPTIONS -V --version
Print version number and exit
-h --help
Display usage information (this message)
-n --suppress
do no print start and OK|FAILED
-s --silent
silent mode
-e --error
log level error
-w --warn
log level warn
-i --info
log level info
-d --debug
log level debug for script debugging
-p --debug-system
log level debug-system to log more details
-L --list-commands
List all available script commands
-C --help-command
Print help for specific command
-t --duration
Print test duration
-T --timestamp
Time stamp on every run
-S --shell
Shell mode
-S --shell
Shell mode
-D --define
Define variables
EXAMPLES
httest script.htt
httest -Ts script.htt
SCRIPTS
httest is script based. The following script examples can be but into a scripte i.e. sample.htt and can be called like
httest sample.htt
SIMPLE SCRIPT
Get a page and do expect return code 200 OK.
CLIENT
_REQ www.google.ch 80
__GET /search?q=apache HTTP/1.1
__Host: www.google.ch
__
_EXPECT headers "HTTP/1.1 200 OK"
_WAIT
END
CUT AND PAST SCRIPT
Cut and past from a HTTP stream, i.e we cut the apache host to access it in the second request.
CLIENT
_REQ www.google.ch 80
__GET /search?q=apache HTTP/1.1
__Host: www.google.ch
__
_MATCH body '<a href="http://([^/]*)/" class=l>Welcome! - The <em>Apache</em> HTTP Server Project' APACHE_HOST
_WAIT
_REQ $APACHE_HOST 80
__GET / HTTP/1.1
__Host: $APACHE_HOST
__
_WAIT
END
CLIENT SERVER SCRIPT
We can hold client and server in the same host. Actually multiple client and multiple server. Very useful to test forward or reverse prox-
ies. Or a webapplication which communicat itself with third party servers i.e. mail server.
This is a very basic selfcontained test you can run on any maschine.
CLIENT
_REQ localhost 8080
__GET /foo HTTP/1.1
__Host: localhost
__
_WAIT
END
SERVER 8080
_RES
_EXPECT "/foo"
_WAIT
__HTTP/1.1 200 OK
__Content-Length: AUTO
__
__Hello World
END
SSL SCRIPT
Of course SSL do also work with httest, just put "SSL:" before port.
CLIENT
_REQ localhost SSL:8080
__GET /foo HTTP/1.1
__Host: localhost
__
_WAIT
END
SERVER SSL:8080
_RES
_EXPECT "/foo"
_WAIT
__HTTP/1.1 200 OK
__Content-Length: AUTO
__
__Hello World
END
AUTHOR
Written by Christian Liesch
REPORTING BUGS
Report bugs to http://sourceforge.net/projects/htt
COPYRIGHT
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
httest 2.2.6 June 2012 HTTEST(1)