10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to find patterns in files using grep -l -e. I specifically am searching for abc. I want any file that has abc in it, but not just the letters abc. I am searching for a pattern a followed by b followed by c. I have tried egrep -l and also I have tried the following:
grep -el... (2 Replies)
Discussion started by: newbie2010
2 Replies
2. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I have to write a script using sed, which delete everything between curly brackets and the brackets themself. The brackets might be nested.
The input-file is:
aaa { bbb ccc { ddd eee } fff { ... (2 Replies)
Discussion started by: FuzzyGnome
2 Replies
3. Shell Programming and Scripting
I want to match the number exactly from the variable which has multiple numbers seperated by pipe symbol similar to search in egrep.below is the code which i tried
#!/usr/bin/perl
my $searchnum = $ARGV;
my $num = "148|1|0|256";
print $num;
if ($searchnum =~ /$num/)
{
print "found";
}... (2 Replies)
Discussion started by: kar_333
2 Replies
4. Shell Programming and Scripting
I seem to be having an issue with an egrep command and I think its the way it is interpreting my regex.
I have a test file..
###FIND THESE###
telnet
/telnet
`telnet -l`
###Dont FIND THESE###
donotfindtelnet
telnetdontfind
Working Regex on Linux/Solaris
egrep '\<(telnet|rcp)\>' $file
... (4 Replies)
Discussion started by: nitrobass24
4 Replies
5. UNIX for Dummies Questions & Answers
Hello, I am kind of a noob with unix, so i'd like some help.
I am trying to get some ip address with an nmap scan and then put from the result of the scan only the ip numbers
this is an example
Starting Nmap 5.21 ( Nmap - Free Security Scanner For Network Exploration & Security Audits )... (3 Replies)
Discussion started by: AscaL
3 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to validate if a string matches a regular expression, but it is not working. Am I missing something? Do I need to scape any of the characters?
if echo 'en-GB' | egrep '({1,8})(-{1,8})*' >/dev/null; then
echo Valid value
fi
Thanks in advance (6 Replies)
Discussion started by: skrtxao
6 Replies
7. Shell Programming and Scripting
Hi, i have a a bunch of directories that are always named with six lowercase alpha's and either one or two numeric's (but no more)
so for example names could be
qwerty1
qwerty9
qwerty10
qwerty67
I am currently using two pattern matches to capture these names
echo $DIR |... (8 Replies)
Discussion started by: rethink
8 Replies
8. Shell Programming and Scripting
Hi guys
I need to find both negative and positive numbers from the following text file. And i also dont need 0.
0
8
-7
-2268
007
-07
-00
-0a0
0a0
-07a0
7a00
0a0
Can someone please give a regex to filter out the values in red. I tried a few things in awk but it didnt work... (9 Replies)
Discussion started by: sridanu
9 Replies
9. Shell Programming and Scripting
Hi,
I have a file with some words divided into syllables by the character "|" (pipe).
For example zu|ri|ghe|se.I would like a regex that matches all the words that are not divided in syllables.All the word that have no "|" pipe character.I have thought at
$echo "zu|ri|ghe|se" | grep ''
... (7 Replies)
Discussion started by: and77
7 Replies
10. Shell Programming and Scripting
I'm using the URL Regex feature of Squid for allowing sites via a list of regex strings to match allowed domains. The regex was actually copied from our previous proxy solution and it seemed to "just work". But, we've recently discovered that some domains (likely due to virtual hosts or host... (2 Replies)
Discussion started by: deckard
2 Replies