Sponsored Content
Full Discussion: Exclude dash in grep
Top Forums Shell Programming and Scripting Exclude dash in grep Post 302758955 by Subbeh on Monday 21st of January 2013 05:51:59 AM
Old 01-21-2013
Exclude dash in grep

Hi,

I must be overlooking something, but I don't understand why this doesn't work. I'm trying to grep on a date, excluding all the lines starting with a dash:

testfile:
Code:
#2013-12-31
2013-12-31

code:
Code:
grep '^[^#]2013-12-31' testfile

I'm expecting to see just the second line '2013-12-31' but I don't get any results. grep -v is not an option btw.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep - to exclude lines beginning with pattern

11132 13069 11137 11142 13070 Can I use grep command to exclude all lines beginning with 13? I dont want to use grep -v 13 as potentially there will be a number with something like 11013 that I would exclude in error.. (2 Replies)
Discussion started by: frustrated1
2 Replies

2. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies

3. UNIX for Dummies Questions & Answers

grep exclude/find single and double quotes

Hello, I'm trying to use grep or egrep to exclude a whole range of characters but how do I exclude both a single and a double quote. It might be easier to say how do I use grep to find both single and double quotes. grep ' ' " ' file grep detects the first single quote within my... (4 Replies)
Discussion started by: Lindy_so
4 Replies

4. UNIX for Advanced & Expert Users

grep source code and exclude comments

I often find myself grepping source code for a variable name and many times the name would be present in comment lines that I 'd prefer not to see. Do you guys know any tricks to filter out comments? Example: snippet of the source code /*** * type comment 1 ***/ void ... (7 Replies)
Discussion started by: migurus
7 Replies

5. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

6. Shell Programming and Scripting

Using Grep Include/Exclude Files

I wrote this korn script and ran into a hole. I can use find to exclude all the hidden directories and to use my include file/exclude files for running a full backup find / -depth -ipath '/home/testuser/.*' -prune -o -print| grep -f include.mydirs | grep -v -f exclude.mydirs but when I... (8 Replies)
Discussion started by: metallica1973
8 Replies

7. UNIX for Advanced & Expert Users

Exclude dash (-) from word separators in vi

vi uses dash and space as word separators. is there any way to exclude dash from word separators ? This is required to work with the symbols generated by ctags exe. when symbol contain a "-" ,vi tags fails to locate that even though symbol is generated properly. For example Symbol -... (3 Replies)
Discussion started by: cabhi
3 Replies

8. Shell Programming and Scripting

Grep for a srting & exclude two folders

Hi, Below is the command to grep for a string under grep -r "redeem" /home/tom Need to make it case insensitive and exclude logs & tmp folders under /home/tom directory in my Search. Need this in Linux. (1 Reply)
Discussion started by: mohtashims
1 Replies

9. Shell Programming and Scripting

Exclude multiple lines using grep

Hi, I'm working on a shell script that reports service status on a database server. There are some services that are in disabled status that the script should ignore and only check the services that are in Enabled status. I output the service configuration to a file and use that information to... (5 Replies)
Discussion started by: senthil3d
5 Replies

10. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 08:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy