Comparison operators: shortcut name


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Comparison operators: shortcut name
# 1  
Old 09-16-2009
Comparison operators: shortcut name

There are a number of comparison operators used in scripting and programming languages, such as the following:
Code:
=, ==, ===, !=, =~, <, >, <=, >=, etc

Is there a shortcut name for them, such as one has for [A-Z] as being any capital letter? If not, it would mean that I would have to list them all for a grep / sed statement I am building.
# 2  
Old 09-16-2009
use posix character classes '[:alnum:]' defines everything printable except punctuation
and those characters. Generally if you want to delete them all
Code:
echo '%$#@!^&*()_-+=|?>< abCD' | tr -dc '[:alnum:]'

# 3  
Old 09-16-2009
Thank you for your answer, but when trying your statement, it seems that "!^" is interpreted as a filename used in earlier commands on the command line, and yields error message:
Code:
Badly placed ()'s.

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating a shortcut

Hi, I want to match a column of one file with many others and take the average of each one and put them into one file (I know sounds complicated). so the 1st file is just a list of names that I want to match with the 2nd file that have names along with rows of values. awk... (4 Replies)
Discussion started by: kylle345
4 Replies

2. Homework & Coursework Questions

Operators

I really don't know the meaning of these operators. Could someone explain the meanings? <, <=, ==, !=, >=, >, ||, &&, ! ~ , !~ Thanks! (1 Reply)
Discussion started by: Erjen
1 Replies

3. Shell Programming and Scripting

Operators

I really don't know the meaning of these operators. Could someone explain the meanings so I can make my test for today? <, <=, ==, !=, >=, >, ||, &&, ! ~ , !~ Thanks! (1 Reply)
Discussion started by: Erjen
1 Replies

4. Shell Programming and Scripting

string comparison operators, what are they??

hi guys im a newbie to shell scripting and would appreciate any help possible. my questions will be very straight forward and relatively trivial to most of you. as the thread title is asking, what are the operators?? i know there's the != and =, but for bourne and c shell, what are the... (12 Replies)
Discussion started by: ballazrus
12 Replies

5. UNIX for Dummies Questions & Answers

Operators

I am trying to understand Does the following: {tmp+=$10} Mean take $10 and add them all up and call it tmp thanks! (2 Replies)
Discussion started by: llsmr777
2 Replies

6. Shell Programming and Scripting

Get Comparison operators from with RexExp

Hello all im trying to get the Comparison operators from string with out much success I have : $myvar = "if (hhhh <= blah.count )" ; when I do : if ($myvar =~ m/.*().*/){ ....... } I keep getting the "=" and not "<=" why ? (3 Replies)
Discussion started by: umen
3 Replies

7. Shell Programming and Scripting

Is there a shortcut in awk?

Is there a key board shortcut in vi editor to allow me to find the next ( or { that are corresponding to the first one? Thanks! It's % sign. (1 Reply)
Discussion started by: whatisthis
1 Replies

8. UNIX for Dummies Questions & Answers

Shortcut thing?

Hey, im new to Linux...totally new. I know there is a way to assign a type of variable or something to a directory, so instead of having to type "cd /var/www" etc, I could just assign a variable to the directory, so I could just do "cd $assignedvar" and it would be there...if you get what I... (0 Replies)
Discussion started by: mo0ness
0 Replies

9. UNIX for Dummies Questions & Answers

Shortcut

Dear Friends How i make shortcut in Tru64 unix for example make a shortcut for mail , i want to make a shortcut under / root the bath for mail # cd /var/spool/mail Regards, (1 Reply)
Discussion started by: fmmq
1 Replies

10. UNIX for Dummies Questions & Answers

shortcut in unix?

Sorry, anybody here knows how to make a shortcut in unix? Thanks. Sebastian. (4 Replies)
Discussion started by: seba
4 Replies
Login or Register to Ask a Question