9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I tried to ease text searches so made a customized grep:
g () {
if
then
i=
for s in $2
do
i="$i --include=*.$s"
done
else
i='--include=*.txt --include=*.ini --include=*.*sh --include=*.c* --include=*.h --include=*.js --include=*.reg'
fi
grep -P -e \'$1\' -r "$i"
}
but I... (3 Replies)
Discussion started by: abdulbadii
3 Replies
2. UNIX for Dummies Questions & Answers
I have a file that looks like this:
>Sample 539
GCCCAGCGCGCGILTGCCGCCGTCTCCGCCTGTCJOHNCCGCCATTGCCCCCGGTTAC
I am using the following code to search specific patterns:
awk '/^>/ { print $0 } NR==2 {if (/GIL/) { print "\t" "1" } else { print "\t" "0" }} NR==2 {if (/JOHN/) { print "\t""\t"... (7 Replies)
Discussion started by: Xterra
7 Replies
3. Shell Programming and Scripting
I use this command to find a search (Nr of active alarms are) and print one line before and 10 lines after the search keywords.
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=1 a=10 s="Nr of active alarms are:" *.log
However, I would like to know how to tell it to print... (3 Replies)
Discussion started by: tthach830
3 Replies
4. Shell Programming and Scripting
Hi All
I have a whole block of pages that have come in from various sources, unfortunately the pages in many instances have blocks of corrupted text. What I'm trying to do is write a sed line that will just delete non alphanumeric characters if they're in a block of say three or four... (5 Replies)
Discussion started by: Bashingaway
5 Replies
5. UNIX and Linux Applications
I just configured my ldap server in Alpine, but every search hangs indefinitely (or so it seems) and I have to end up killing Alpine and starting back up. The LDAP server runs over SSL on port 636, so I have specified port 636, but there doesn't seem to be an SSL option available so I turned on... (0 Replies)
Discussion started by: retrovertigo
0 Replies
6. Shell Programming and Scripting
I am aware that Perl has a lot of features that originally came from sed and awk. I have a pattern that I am using like this:
sed -n '/|Y|/p'
I want to do the same thing in Perl and be able to either save that value in some kind of variable or array or potentially write it out to a file.
... (11 Replies)
Discussion started by: masinick
11 Replies
7. Shell Programming and Scripting
Hello. Could do with some help on where to get started really. If anyone could help me it would be greatly appreciated.
I have been working on this for a while now and I don't really know where to start but I am looking into creating a script that will process website hit files and output... (2 Replies)
Discussion started by: amatuer_lee_3
2 Replies
8. News, Links, Events and Announcements
See this article:
http://story.news.yahoo.com/news?tmpl=story&cid=74&ncid=738&e=9&u=/cmp/20030809/tc_cmp/13000487 (3 Replies)
Discussion started by: Neo
3 Replies
9. UNIX for Dummies Questions & Answers
I want to search the file /etc/passwd for all lines containing 'csh' but exlude all those lines that have '/usr' in them and dump the results into the file result.
IMPORTANT: I need to do this in one command line.
The following does not work:
grep -v \(\/usr\) \(csh\) /etc/passwd >... (4 Replies)
Discussion started by: sdemba
4 Replies