Sponsored Content
Full Discussion: Conversion to uppercase - tr
Top Forums Shell Programming and Scripting Conversion to uppercase - tr Post 302205834 by Franklin52 on Monday 16th of June 2008 11:48:45 AM
Old 06-16-2008
Replace this:

Code:
fieldToCheck= $i | tr '[a-z]' '[A-Z]'
if (index($fieldToCheck,"ABC")>0){print $i};
if (index($fieldToCheck,"XYZ")>0){print $i};

with:

Code:
fieldToCheck=toupper($i)
if (index(fieldToCheck,"ABC")>0){print $i}
if (index(fieldToCheck,"XYZ")>0){print $i}

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

uppercase to lowercase

Greetings & Happy New Years To All! A client of mine FTP'ed their files up to the server and it all ended up being in UPPERCASE when it all should be in lowercase. Is there a builtin command or a script anyone knows of that will automagically convert all files to lowercase? Please advise asap... (4 Replies)
Discussion started by: webex
4 Replies

2. Shell Programming and Scripting

Converting to Uppercase

I want to convert string into uppercase string. How can i do that ? Ex: Enter the user name: read name show=upper(name) echo $show --- This output should be the uppercase output. Thanks (3 Replies)
Discussion started by: dreams5617
3 Replies

3. UNIX for Dummies Questions & Answers

make uppercase

If in a script I am taking an input (R201) for example and assigning it to a variable, how would I change the R to uppercase if it was keyed in as r201? I can't seem to get it to work with toupper (4 Replies)
Discussion started by: kirkm76
4 Replies

4. UNIX for Dummies Questions & Answers

BASH uppercase conversion

How can I convert a variable to uppercase like ksh, typeset -u $1 in bash? (1 Reply)
Discussion started by: stringdom
1 Replies

5. Shell Programming and Scripting

only uppercase first character?

should be a simple question, I am trying to uppercase every first character in a word on the list. abc google cnn services My first thought was sed 'y/^/^/', but it changed all the characters, not just the first character. any thoughts? (7 Replies)
Discussion started by: fedora
7 Replies

6. AIX

Lowercase to Uppercase

Inside a script I have 2 variables COMP=cy and PT=t. further down the same script I require at the same line to call those 2 variables the first time uppercase and after lowercase ${COMP}${PT}ACE,${COMP}${PT}ace. Can somebody help me Thanks in advance George Govotsis (7 Replies)
Discussion started by: ggovotsis
7 Replies

7. UNIX for Dummies Questions & Answers

UPPERCASE to lowercase

Hi All, i have a file and i want to convert all uppercase letters to lowercase letters which are in my file. how can i do this. Thanx (3 Replies)
Discussion started by: temhem
3 Replies

8. Shell Programming and Scripting

Change to uppercase

Hi I have a string(can be mix of upper and lower case) and need the first three chars of the string to be converted to uppercase (4 Replies)
Discussion started by: Northpole
4 Replies

9. Shell Programming and Scripting

Uppercase to lowercase

Hello, I have a list of files in a directory whose names are all in uppercasse, including the file format for eg *.MP3 . I would like to convert these to the normal way we write it ie ABC.MP3 to be converted to Abc.mp3 . I know that this can be done manually by using a lot of "mv" or rename... (6 Replies)
Discussion started by: ajayram
6 Replies

10. Shell Programming and Scripting

Uppercase variable

Hello, This is not a problem specific question. While surfing on google to find a solution for the latest error messages I have received from command line, I found some suggestions regarding usage of linux commands: Could it be a problem specific comment or in most cases, `` causes issue?... (6 Replies)
Discussion started by: baris35
6 Replies
Interface::Simple(3pm)					User Contributed Perl Documentation				    Interface::Simple(3pm)

NAME
IO::Interface::Simple - Perl extension for access to network card configuration information SYNOPSIS
use IO::Interface::Simple; my $if1 = IO::Interface::Simple->new('eth0'); my $if2 = IO::Interface::Simple->new_from_address('127.0.0.1'); my $if3 = IO::Interface::Simple->new_from_index(1); my @interfaces = IO::Interface::Simple->interfaces; for my $if (@interfaces) { print "interface = $if "; print "addr = ",$if->address," ", "broadcast = ",$if->broadcast," ", "netmask = ",$if->netmask," ", "dstaddr = ",$if->dstaddr," ", "hwaddr = ",$if->hwaddr," ", "mtu = ",$if->mtu," ", "metric = ",$if->metric," ", "index = ",$if->index," "; print "is running " if $if->is_running; print "is broadcast " if $if->is_broadcast; print "is p-to-p " if $if->is_pt2pt; print "is loopback " if $if->is_loopback; print "is promiscuous " if $if->is_promiscuous; print "is multicast " if $if->is_multicast; print "is notrailers " if $if->is_notrailers; print "is noarp " if $if->is_noarp; } DESCRIPTION
IO::Interface::Simple allows you to interrogate and change network interfaces. It has overlapping functionality with Net::Interface, but might compile and run on more platforms. Class Methods $interface = IO::Interface::Simple->new('eth0') Given an interface name, new() creates an interface object. @iflist = IO::Interface::Simple->interfaces; Returns a list of active interface objects. $interface = IO::Interface::Simple->new_from_address('192.168.0.1') Returns the interface object corresponding to the given address. $interface = IO::Interface::Simple->new_from_index(2) Returns the interface object corresponding to the given numeric index. This is only supported on BSD-ish platforms. Object Methods $name = $interface->name Get the name of the interface. The interface object is also overloaded so that if you use it in a string context it is the same as calling name(). $index = $interface->index Get the index of the interface. This is only supported on BSD-like platforms. $addr = $interface->address([$newaddr]) Get or set the interface's address. $addr = $interface->broadcast([$newaddr]) Get or set the interface's broadcast address. $addr = $interface->netmask([$newmask]) Get or set the interface's netmask. $addr = $interface->hwaddr([$newaddr]) Get or set the interface's hardware address. $addr = $interface->mtu([$newmtu]) Get or set the interface's MTU. $addr = $interface->metric([$newmetric]) Get or set the interface's metric. $flags = $interface->flags([$newflags]) Get or set the interface's flags. These can be ANDed with the IFF constants exported by IO::Interface or Net::Interface in order to interrogate the state and capabilities of the interface. However, it is probably more convenient to use the broken-out methods listed below. $flag = $interface->is_running([$newflag]) $flag = $interface->is_broadcast([$newflag]) $flag = $interface->is_pt2pt([$newflag]) $flag = $interface->is_loopback([$newflag]) $flag = $interface->is_promiscuous([$newflag]) $flag = $interface->is_multicast([$newflag]) $flag = $interface->is_notrailers([$newflag]) $flag = $interface->is_noarp([$newflag]) Get or set the corresponding configuration parameters. Note that the operating system may not let you set some of these. AUTHOR
Lincoln Stein <lstein@cshl.org> This module is distributed under the same license as Perl itself. SEE ALSO
perl, IO::Socket, IO::Multicast), IO::Interface, Net::Interface perl v5.14.2 2007-01-22 Interface::Simple(3pm)
All times are GMT -4. The time now is 07:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy