Sponsored Content
Top Forums Shell Programming and Scripting simple grep is not working for me Post 302303438 by marcus121 on Thursday 2nd of April 2009 03:39:26 PM
Old 04-02-2009
Quote:
Originally Posted by siquadri
Try this
Code:
grep -w 500 access

Just be careful with this approach. It includes non-word constituents, such as $500 or you might get a number like 159.500.3.24 or something like that.

Of course the down-side to the approach I stated (space sandwich) is if 500 is the first, last or only word of the line, so you need to consider if that's a possiblity. You can get around that like so:
Code:
grep -E " 500 |^500 | 500$|^500$" access


Last edited by marcus121; 04-02-2009 at 04:48 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why this simple script, is not working ?

Hi everybody I want to create 20 file using simple script - listed bellow-. But the script doesn't work. I hope anyone guide me to correct this script ---------------- The script integer number=01 until (($number==21)) do >TELE-LOG-$number number=$number+01 echo $number done exit... (4 Replies)
Discussion started by: so_friendly
4 Replies

2. Shell Programming and Scripting

simple perl script not working

why won't below work? I am trying to see a)sipfile has username of the system. b)it will read the sipfile and do a grep function against the /etc/passwd c)it will save that output to /tmp/result.. but my script is just hanging... #!/usr/bin/perl -w open(SIPFILE, "</tmp/sipfile") ... (4 Replies)
Discussion started by: hankooknara
4 Replies

3. Shell Programming and Scripting

Simple BASH script not working?

So I need a script that does the following: If a certain user is logged in Run `command` Else Echo “incorrect user” This is my first stab...which doesn't work: #!/bin/bash X="user=`ls -l /dev/console | cut -d " " -f 4`" Y="foobar" echo $X echo $Y (4 Replies)
Discussion started by: doubleminus
4 Replies

4. Shell Programming and Scripting

simple cgi script not working

hi all, i have installed simple cgi-script under apache/cgi-bin directory hello.cgi #!/usr/bin/perl print "Content-type: text/html\n\n"; print <<END_HTML; <html> <head></head> <body>Hello, World!</body> </html> END_HTML when i hit the url... (6 Replies)
Discussion started by: raghur77
6 Replies

5. Shell Programming and Scripting

A simple variable subst is not working

Hi what i want: listing files in a special range ls -lrt 20120601{05..06}* ... -rw-rw-r-- 1 imp imp 279 1. Jun 07:51 201206010550 -rw-rw-r-- 1 imp imp 279 1. Jun 07:01 201206010600 -rw-rw-r-- 1 imp imp 279 1. Jun 07:11 201206010610 -rw-rw-r-- 1 imp imp 279 1. Jun 07:21... (1 Reply)
Discussion started by: IMPe
1 Replies

6. Shell Programming and Scripting

[Solved] Simple script not working- for loop

Hi all, Please guide me writing this script Follwing is the file which I have created, which contains the files to be copied. cat system1-dr.txt /etc/passwd /etc/shadow /etc/group /etc/vfstab /etc/profile /etc/default/init /etc/shells /etc/dfs/dfstab /etc/dfs/sharetab... (11 Replies)
Discussion started by: manalisharmabe
11 Replies

7. UNIX for Dummies Questions & Answers

A simple join, but nothing is working out for me

Guys, I want to join two files. You might have seen this many times. I just don't get the desired output. Searching the forum, No proper links :( Input: File1 test1 test2 test3 File2 is bad is not bad Output Needed: test1 is bad test2 is bad (4 Replies)
Discussion started by: PikK45
4 Replies

8. Shell Programming and Scripting

Simple sftp script not working - Please help

I have the below sftp script to transfer a file from a linux host(source) to another linux host(target). Public key is already set up in target host and I am able to transfer file using sftp from source to target. But not sure why the below script(ftp_script) is not working. Any help in this... (3 Replies)
Discussion started by: Armaan
3 Replies

9. Shell Programming and Scripting

Simple grep is not working properly on busybox

Hi, I'm trying to write shell scripts on busybox bash on windows and grep is not working for simple regular expression like $ grep FEN * bash: grep: Invalid argument but the same grep works fine if use the single file instead of asterisk $ grep FEN test $ Am I doing something... (5 Replies)
Discussion started by: prvnrk
5 Replies

10. Shell Programming and Scripting

Simple Variable substitution in ksh not working

Hi Gurus, Not able to catch what's going wrong here. I just want to get output as "tree". server:/mk/app/nexapp $ echo $SHELL /usr/bin/ksh server:/mk/app/nexapp $ export db_name1="tree" server:/mk/app/nexapp $ export i=1 1st try: server:/mk/app/nexapp $ echo $(db_name$i) ksh: db_name1: ... (3 Replies)
Discussion started by: mukesh.lalwani
3 Replies
NSIS(1) 							      GenPat								   NSIS(1)

NAME
GenPat - A program to create patch files in VPatch format. SYNOPSIS
GenPat [-R] [-B=64] [-V] [-O] [-A=500] [source] [target] [patch.pat] DESCRIPTION
This manual page documents briefly the GenPat command. This manual page was written for the Debian (TM) distribution because the original program does not have a manual page. Instead, it has documentation in the HTML format; see below. GenPat is a program that creates installer programs for Windows. OPTIONS
-R Replace a patch with same contents as source silently if it already exists. -B=64 Set blocksize (default=64), multiple of 2 is required. -V More verbose information during patch creation. -O Deactivate match limit of the -A switch (sometimes smaller patches). -A=500 Maximum number of block matches per block (improves performance). Default is 500, larger is slower. Use -V to see the cut-off aborts. EXIT STATUS
0 Success 1 Arguments missing 2 Other error 3 Source file already has a patch in specified patch file (=error) SEE ALSO
GenPat is documented more fully in the HTML file /usr/share/doc/nsis/Docs/VPatch/Readme.html. AUTHOR
This manual page was written by Paul Wise pabs@debian.org for the Debian (TM) system. AUTHOR
Paul Wise Created man page COPYRIGHT
Copyright (C) 2005 Paul Wise GenPat manual October 5, 2005 NSIS(1)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy