Sponsored Content
Full Discussion: grep problem
Top Forums UNIX for Dummies Questions & Answers grep problem Post 57747 by cbkihong on Friday 5th of November 2004 08:06:02 AM
Old 11-05-2004
\ is to escape the dot (.). In regular expression, a dot matches any single character. Escaping it means to treat the metacharacter (i.e. the dot in this case) literally.

$ matches the end-of-line. So, if you don't want to match something like .Za .ZIP etc. don't forget to have the $ in.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep problem

Hi I would like to know wheather there is anyway to pass a variable to grep argument like this grep "$myvar" $myfile i would put this in a function and then call this function by setting different values to myvar and myfile. is this possible at all. regards Hrishy (4 Replies)
Discussion started by: xiamin
4 Replies

2. Shell Programming and Scripting

Grep Problem

I have a large file that I am grepping to find a certain string. grep 'C:\Data\Directory\Test.txt' test.txt It can not find it even though I know it is in there . I know that there is a problem with the backslashes but I can't get it to work. I tried grep... (2 Replies)
Discussion started by: lesstjm
2 Replies

3. UNIX for Dummies Questions & Answers

Grep problem

Hi there, this is a very simple question. When I do grep -c "PWD" filename, I get 5. This means the filename contains 5 lines of "PWD" occurence. I tried to assign to a variable. int= grep -c "PWD" filename When I typed echo $int The output: 5 I get an empty line space. Now I... (1 Reply)
Discussion started by: felixwhoals
1 Replies

4. Shell Programming and Scripting

GREP problem

I have a problem. Suppose I have a log named transport.log >> tp finished with return code: 203 meaning: wrong syntax in tp call .... tp finished with return code: 0 meaning: Everything ok. << What i want to do is to get the return code of the 1st one. So I would probably do:... (2 Replies)
Discussion started by: kdyzsa
2 Replies

5. Homework & Coursework Questions

Grep problem

Changed Problem its a sed actually... Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Use a sed command to create an output file from the input file. The input... (2 Replies)
Discussion started by: skalidindi
2 Replies

6. Shell Programming and Scripting

problem with grep |

Hi, When i try this it is not executing either result or total, pls can any one help me in this. max=month_134.log grep result|total $max > log.txt In month_134.log, it should contain either result or total and then send it to log.txt.It should execute result or total in log.txt ... (3 Replies)
Discussion started by: NehaKrish
3 Replies

7. UNIX for Dummies Questions & Answers

problem with grep

Hi I am trying to grep a string in a directory which is having 5000 files. PA>> grep -iH 'linc.unisure_pr13n' * bash: /usr/bin/grep: Arg list too long I am getting the error. i also tried PA>> ls -ltr | grep -iH 'linc.unisure_pr13n' * but still i am getting the error Please Advice... (4 Replies)
Discussion started by: subhotech
4 Replies

8. Shell Programming and Scripting

grep problem

Hi everyone i am facing a strange problem in grep below is the code RC=0 grep $ERROR_MASK $LOG_FILE 2>&1 > /dev/null && RC=1 || RC=0 what does the above statment do i mean it search for error mask into log file and redirect the error to console null then what's the meaning of RC=1 ||... (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

9. Shell Programming and Scripting

Grep problem

Hello. I'm learning shell scripting right now and I'm trying simple scripts. I have a problem with the one below. The idea is to found the number of files containing asd in their name. Here's the code: #!/bin/sh pattern=asd total=0 for f in * do && continue if grep $pattern $f >... (3 Replies)
Discussion started by: EmZvr
3 Replies

10. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies
BACKUP_ADDVOLENTRY(8)					       AFS Command Reference					     BACKUP_ADDVOLENTRY(8)

NAME
       backup_addvolentry - Defines a volume entry in a volume set

SYNOPSIS
       backup addvolentry -name <volume set name>
	   -server <machine name>
	   -partition <partition name>
	   -volumes <volume name (regular expression)>
	   [-localauth] [-cell <cell name>] [-help]

       backup addvole -n <volume set name>
	   -s <machine name>
	   -p <partition name>
	   -v <volume name (regular expression)>
	   [-l] [-c <cell name>] [-h]

DESCRIPTION
       The backup addvolentry command adds a volume entry definition to the existing volume set named by the -name argument. A volume entry
       definition can match one or more volumes, depending on the combination of the -server, -partition, and -volumes arguments.

       For the -server and -partition arguments, provide either

       o   The name of one machine or partition.

       o   The metacharacter expression .* (period and asterisk), which matches every machine name or partition name in the Volume Location
	   Database (VLDB).

       For the -volumes argument, specify a combination of alphanumeric characters and one or more metacharacters to wildcard part or all of the
       volume name. OPTIONS lists the acceptable metacharacters.

CAUTIONS
       It is best to issue this command in interactive mode. If issuing it at the shell prompt, enclose any strings containing metacharacters in
       double quotes, or escape the metacharacters with other delimiters, to prevent the shell from interpreting them. Adding volume entries to a
       temporary volume set is possible only within the interactive session in which the volume set was created.

OPTIONS
       -name <volume set name>
	   Names the volume set to which to add this volume entry definition.  The volume set must already exist (use the backup addvolset command
	   to create it).

       -server <machine name>
	   Defines the set of one or more file server machines that house the volumes in the volume entry. Provide either one fully-qualified
	   hostname (such as "fs1.abc.com") or the metacharacter expression ".*" (period and asterisk), which matches all machine names in the
	   VLDB.

       -partition <partition name>
	   Defines the set of one or more partitions that house the volumes in the volume entry. Provide either one complete partition name (such
	   as "/vicepa") or the metacharacter expression ".*" (period and asterisk), which matches all partition names.

       -volumes <volume name>
	   Defines the set of one or more volumes included in the volume entry. Specify the volumes by name, by using any combination of regular
	   alphanumeric characters and one or more of the following metacharacter expressions:

	   .   The period matches any single character.

	   *   The asterisk matches zero or more instances of the preceding character.	Combine it with any other alphanumeric character or
	       metacharacter.

	   [ ] Square brackets around a list of characters match a single instance of any of the characters, but no other characters; for example,
	       "[abc]" matches a single "a" or "b" or "c", but not "d" or "A". This expression can be combined with the asterisk.

	   ^   The caret, when used as the first character in a square-bracketed set, designates a match with any single character except the
	       characters that follow it; for example, "[^a]" matches any single character except lowercase "a". This expression can be combined
	       with the asterisk.

	      A backslash preceding any of the metacharacters in this list makes it match its literal value only. For example, the expression
	       "." (backslash and period) matches a single period, "*" a single asterisk, and "\" a single backslash.  Such expressions can be
	       combined with the asterisk (for example, ".*" matches any number of periods).

	   Perhaps the most common metacharacter expression is the period followed by an asterisk (".*"). This expression matches any string of
	   any length, because the period matches any character and the asterisk means any number of that character. As mentioned, it is the only
	   acceptable metacharacter expression for the -server and -partition arguments. In a volume definition it can stand alone (in which case
	   it matches every volume listed in the VLDB), or can combine with regular characters. The following example matches any volume name that
	   begins with the string "user" and ends with "backup":

	      user.*backup

       -localauth
	   Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to
	   the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more
	   details, see backup(8).

       -cell <cell name>
	   Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8).

       -help
	   Prints the online help for this command. All other valid options are ignored.

EXAMPLES
       The following command adds a volume entry to the volume set called "sys". The entry matches all volumes on any machine or partition whose
       names begin with the string "sun4x_56" followed by a period:

	  backup> addvolentry sys .* .* sun4x_56..*

       The following command adds a volume entry to the volume set called "fs2", to match all volumes on the /vicepb partition of file server
       machine "fs2.abc.com". Because it is issued at the shell prompt, double quotes surround the metacharacters in the -volumes argument. (The
       command is shown here on two lines only for legibility reasons.)

	  % backup addvolentry -name fs2 -server fs2.abc.com 
			       -partition /vicepb -volumes ".*"

       The chapter in the OpenAFS Administration Guide about configuring the AFS Backup System presents additional examples as well as advice on
       grouping volumes.

PRIVILEGE REQUIRED
       The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged
       onto a server machine as the local superuser "root" if the -localauth flag is included.

SEE ALSO
       backup(8), backup_addvolset(8), backup_delvolentry(8), backup_delvolset(8), backup_listvolsets(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26						     BACKUP_ADDVOLENTRY(8)
All times are GMT -4. The time now is 09:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy