Sponsored Content
Full Discussion: metacharacters separation
Top Forums Shell Programming and Scripting metacharacters separation Post 302488161 by ozum on Saturday 15th of January 2011 01:46:23 PM
Old 01-15-2011
metacharacters separation

I have prepared a script to submit a string in a txt file.
However there are somethings that I have to check before submitting the string in the txt file.
One of those checks is to determine whether the string entered contains any metacharacters.
I have tried sth like;
Code:
echo "string" | grep -v [a-zA-Z0-9]
echo "string" | egrep -v .|,|!

however it doesn't work.
How can i check whether the string entered includes any metacharacters or not?

Last edited by Franklin52; 01-17-2011 at 04:23 AM.. Reason: Please use code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using metacharacters in loops

Is there a way to use metacharacters in a loop or in an if. I want to allow a user to enter Y, y, Yes, yes, Yah, etc... in a loop I tried: read response while *" ] do........ and while *" ] do ......... this works for grep or egrep but not in loops Why?????? (4 Replies)
Discussion started by: jrdnoland1
4 Replies

2. UNIX for Dummies Questions & Answers

Metacharacters

I want to display an asterisk to the screen as part of a string. I know how to use the Backslash to escape it's value. But how do I display it without showing the Backslash? (1 Reply)
Discussion started by: regencyabs
1 Replies

3. Shell Programming and Scripting

Joining three lines with comma separation

I have a file that looks like this: G. KRESSLAR 9618 W. APPALOOSA DRIVE SUN CITY, AZ 85373 SHIRLEY ALLEN 7272 W. VIA MONTOYA DRIVE GLENDALE, AZ 85310 LOUIS VALDEZ 244441 N. 86TH AVENUE PEORIA, AZ 85383 DONNA NEWBON 3231 W. DENTON #D PHOENIX, AZ 85017 SARAH WILSON 6534 W. PALO... (3 Replies)
Discussion started by: BCarlson
3 Replies

4. Shell Programming and Scripting

Unwanted field separation in awk

Hi everyone, My problem is strange, I cannot think of why this is happening. I have a set of data that looks like this: Although it does not look it, the fields are tab delimited. I have made sure of this, and awk does recognize them as such. However, it divides what I would expect... (2 Replies)
Discussion started by: ccox85
2 Replies

5. Shell Programming and Scripting

Metacharacters analysis

:confused:Hi , Can someone please advise what is the meaning of metacharacters in below code? a_PROCESS=${0##*/} a_DPFX=${a_PROCESS%.*} a_LPFX="a_DPFX : $$ : " a_UPFX="Usage: $a_PROCESS" Regards, gehlnar (3 Replies)
Discussion started by: gehlnar
3 Replies

6. UNIX for Dummies Questions & Answers

The ll command + metacharacters

Hello. I am learning how to use Unix through an online course. Unfortunately the text that we use isn't very good, so I could use some help with a pretty basic question. Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the... (2 Replies)
Discussion started by: feverdream
2 Replies

7. Shell Programming and Scripting

File Separation

Hi I have an XML File with default header($ lines of data) and default tail (Two Lines) and the body has occurrence of start<Folder> and ends with </Folder>. Now i want to split each occurrence i mean each start and end in to separate files with header and tail. For example: header line... (12 Replies)
Discussion started by: Nithin Kumar
12 Replies

8. Shell Programming and Scripting

How to determine column separation format?

Hi there, say I have a line with multiple columns but with different separation formats: spaces, tabs.. Is it possible to have AWK print the separation format between each column? (10 Replies)
Discussion started by: la2015
10 Replies

9. Shell Programming and Scripting

Sum up formatted numbers with comma separation

I need to sum up the values in field nr 5 in a data file that contains some file listing. The 5th field denotes the size of each file and following are some sample values. 1,775,947,633 4,738 7,300 16,610 15,279 0 0 I tried the following code in a shell script. awk '{sum+=$5} END{print... (4 Replies)
Discussion started by: krishmaths
4 Replies
LOCALE_GET_DISPLAY_NAME(3)						 1						LOCALE_GET_DISPLAY_NAME(3)

Locale::getDisplayName - Returns an appropriately localized display name for the input locale

	Object oriented style

SYNOPSIS
publicstatic string Locale::getDisplayName (string $locale, [string $in_locale]) DESCRIPTION
Procedural style string locale_get_display_name (string $locale, [string $in_locale]) Returns an appropriately localized display name for the input locale. If is NULL then the default locale is used. PARAMETERS
o $locale - The locale to return a display name for. o $in_locale -optional format locale RETURN VALUES
Display name of the locale in the format appropriate for $in_locale. EXAMPLES
Example #1 locale_get_display_name(3) example <?php echo locale_get_display_name('sl-Latn-IT-nedis', 'en'); echo "; "; echo locale_get_display_name('sl-Latn-IT-nedis', 'fr'); echo "; "; echo locale_get_display_name('sl-Latn-IT-nedis', 'de'); ?> Example #2 OO example <?php echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en'); echo "; "; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr'); echo "; "; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de'); ?> The above example will output: Slovenian (Latin, Italy, Natisone dialect); slovxc3xa8ne (latin, Italie, dialecte de Natisone; Slowenisch (Lateinisch, Italien, NEDIS) SEE ALSO
locale_get_display_language(3), locale_get_display_script(3), locale_get_display_region(3), locale_get_display_variant(3). PHP Documentation Group LOCALE_GET_DISPLAY_NAME(3)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy