SUNOS NAWK - TOLOWER - In a print statement convert string to lower case 
Author Message
 SUNOS NAWK - TOLOWER - In a print statement convert string to lower case

Quote:

> X-RTcode: e63cbd5232c3113e49164382
> X-Originating-IP-addr: 149.112.8.2

> In this case $1 = NAWK_PROG

> BEGIN { print "I want the following string to be lower case", tolower(\$1) }

> I get an error:  nawk: calling undefined function tolower

> I was able to do this on an Ultrix Unix machine (DEC) but it does not work
> now on SUNOS..

> In a print statement I wanted to make the input of the variable lower case
> characters.

> Michael Catrambone

There might be a Texedit filter 'capitalize' with -l in Sun for just
the job you described.

For example in a script like this:

nawk ' BEGIN {
                print "I want the following string to be lower case"
                system("echo '$1' | capitalize -l")
                }'

this script lowercases the first argument given to the script.

Matti



Sat, 06 Feb 1999 03:00:00 GMT  
 SUNOS NAWK - TOLOWER - In a print statement convert string to lower case

: There might be a Texedit filter 'capitalize' with -l in Sun for just
: the job you described.

: For example in a script like this:

: nawk ' BEGIN {
:               print "I want the following string to be lower case"
:               system("echo '$1' | capitalize -l")
:               }'

: this script lowercases the first argument given to the script.

        If you are going to do that, just use 'tr':

                tr "[A-Z]" "[a-a]"

        Something that every Unix system will have...

--
                        Cheers,
                        Dan Ts'o                        212-327-7671
                        Dept. of Neurobiology           FAX: 212-327-7671
                        The Rockefeller University




Sun, 07 Feb 1999 03:00:00 GMT  
 SUNOS NAWK - TOLOWER - In a print statement convert string to lower case

Quote:
> I was able to do this on an Ultrix Unix machine (DEC) but it does not work
> now on SUNOS..

> Michael Catrambone

There are more versions of AWK, e.g. awk, nawk in /usr/bin and probably
/usr/xpg4/bin/awk, at least in Solaris 2.5. Try last one, it might work.
Check man pages and AnswerBook to be sure.
Jarek


Tue, 09 Feb 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. converting string to lower case

2. Convert All UPPER CASE to Upper and Lower case function

3. REXX and 4OS2 problem: lower-case text gets converted to upper-case

4. converting lower case to upper case

5. converting lower case to upper case

6. convert f77 code from mixed case to lower case

7. Upper case / Lower case I'm a lost case

8. Converting variables in AWK to upper or lower case

9. Converting to lower case

10. Converting To All Upper (Or Lower) Case

11. Easy question: converting characters to lower case

12. Converting To All Upper (Or Lower) Case

 

 
Powered by phpBB® Forum Software