Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

toupper(3) [netbsd man page]

TOUPPER(3)						   BSD Library Functions Manual 						TOUPPER(3)

NAME
toupper -- lower case to upper case letter conversion LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <ctype.h> int toupper(int c); DESCRIPTION
The toupper() function converts a lower-case letter to the corresponding upper-case letter. RETURN VALUES
If the argument is a lower-case letter, the toupper() function returns the corresponding upper-case letter if there is one; otherwise the argument is returned unchanged. SEE ALSO
ctype(3), isalnum(3), isalpha(3), isascii(3), iscntrl(3), isdigit(3), isgraph(3), islower(3), isprint(3), ispunct(3), isspace(3), isupper(3), isxdigit(3), stdio(3), toascii(3), ascii(7) STANDARDS
The toupper() function conforms to ANSI X3.159-1989 (``ANSI C89''). CAVEATS
The argument to toupper() must be EOF or representable as an unsigned char; otherwise, the behavior is undefined. See the CAVEATS section of ctype(3) for more details. BSD
April 17, 2008 BSD

Check Out this Related Man Page

CTYPE(2)							System Calls Manual							  CTYPE(2)

NAME
isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toascii, _toupper, _tolower, toupper, tolower - ASCII character classification SYNOPSIS
#include <u.h> #include <libc.h> #include <ctype.h> isalpha(c) isupper(c) islower(c) isdigit(c) isxdigit(c) isalnum(c) isspace(c) ispunct(c) isprint(c) isgraph(c) iscntrl(c) isascii(c) _toupper(c) _tolower(c) toupper(c) tolower(c) toascii(c) DESCRIPTION
These macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. Isascii is defined on all integer values; the rest are defined only where isascii is true and on the single non-ASCII value EOF; see fopen(2). isalpha c is a letter, a-z or A-Z isupper c is an upper case letter, A-Z islower c is a lower case letter, a-z isdigit c is a digit, 0-9 isxdigit c is a hexadecimal digit, 0-9 or a-f or A-F isalnum c is an alphanumeric character, a-z or A-Z or 0-9 isspace c is a space, horizontal tab, newline, vertical tab, formfeed, or carriage return (0x20, 0x9, 0xA, 0xB, 0xC, 0xD) ispunct c is a punctuation character (one of !"#$%&'()*+,-./:;<=>?@[]^_`{|}~) isprint c is a printing character, 0x20 (space) through 0x7E (tilde) isgraph c is a visible printing character, 0x21 (exclamation) through 0x7E (tilde) iscntrl c is a delete character, 0x7F, or ordinary control character, 0x0 through 0x1F isascii c is an ASCII character, 0x0 through 0x7F Toascii is not a classification macro; it converts its argument to ASCII range by anding with 0x7F. If c is an upper case letter, tolower returns the lower case version of the character; otherwise it returns the original character. Toup- per is similar, returning the upper case version of a character or the original character. Tolower and toupper are functions; _tolower and _toupper are corresponding macros which should only be used when it is known that the argument is upper case or lower case, respectively. Alef These routines are not provided in Alef. SOURCE
/sys/include/ctype.h for the macros. /sys/src/libc/port/ctype.c for the tables. BUGS
These macros are ASCII-centric. CTYPE(2)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File listing

I can't seem to list all the files that begin with a lower case or upper case letter between a-m while being in that directory? Please help I've tried everything from all the ls commands to even grep commands. b (5 Replies)
Discussion started by: Astudent
5 Replies

2. UNIX for Advanced & Expert Users

how to read each letter from file and store it in variable.

Dear friends, i am writing csh script i have one dat file containing following data.like this. 08FD3 03A26 000FA0 FFFF0 BBA0F 00000 00000 from the above file i want to read each letter and store it in one variable. how it is possible. please help (7 Replies)
Discussion started by: rajan_ka1
7 Replies

3. Shell Programming and Scripting

changing first letter to CAPS

Hi, I want to convert the first letter of this word from lowecase to uppercase. Assume a letter united. I want to translate to United Please let me know a simple way to do that. Thanks. (22 Replies)
Discussion started by: Krrishv
22 Replies

4. Shell Programming and Scripting

Compare 2 files and send output to other

Hi, In File1.txt I have text like: 23AA3424DD23|3423ff25sd5345| and so on In File2.txt I have similar text as File1, but with ",": 23aa3424dd23,192.168.1.100, and so on I wan to remove the pipes from File1 and select 5 fields, then remove "," from File2.txt and select 2 fields (IP's... (14 Replies)
Discussion started by: cameleon
14 Replies

5. UNIX for Dummies Questions & Answers

need help with rename

hi guys i am writing a script to change the filename which is enterered as input to lower case letter even if one letter is upper case i have to change it to lower case i get the input and use sed comand should i use like that sed/s/a-z/A-Z/d will it be like that can u please help me (8 Replies)
Discussion started by: farhan_t49
8 Replies

6. Shell Programming and Scripting

Convert to upper case first letter of each word in column 2

Hi guys, I have a file separated by ",". I´m trying to change to upper case the first letter of each word in column 2 to establish a standard format on this column. I hope somebody could help me to complete the SED or AWK script below. The file looks like this: (Some lines in column 2... (16 Replies)
Discussion started by: cgkmal
16 Replies

7. Shell Programming and Scripting

Need to Mask Data

I have an requirement. There is a file which has the below contents Unix|123|17-01-2010 .... .... .... .... and so an now each letter has a corresponding predefined mapping letter in order to mask the original data.(for example U = A, n=b, i=c, x=d, same like number 1=9,2=8,3=7. Also... (8 Replies)
Discussion started by: ksmbabu
8 Replies

8. Shell Programming and Scripting

Scan and change file data content problem

Input file >Read_1 XXXXXXXXXXSDFXXXXXDS (condition 1: After the last "X" per line, if the distance is less than or equal to 3 letter, replace those not "X" letter with "X") TREXXXXXXXSDFXXXXXDS (condition 2: Before the first "X" per line, if the distance is less than or equal to 3 letter,... (12 Replies)
Discussion started by: patrick87
12 Replies

9. Shell Programming and Scripting

issue with toupper in nawk

Hi All, I am seeing an issue while using toupper in nawk. Below is the code that I am using.Toupper method is not working as expected in this case.nawk 'NR==FNR{a=$4" "$5}NR>FNR{print NF?$0:a"\n";if(/^cn:/) x=toupper($0)}' FS="" id_list.txt attributes.txt > out In the above script, id_list... (9 Replies)
Discussion started by: Samingla
9 Replies

10. UNIX for Dummies Questions & Answers

AWK - changing first char from small to upper

I need to write script in AWK, changing first char from a line from lower to upper. I found function toupper etc. but have no idea how to sent only first char from every line instead of the whole line. Anyone has any idea? // Sorry for my english:D (8 Replies)
Discussion started by: bbqtoss
8 Replies

11. Shell Programming and Scripting

delete all characters that aren't a letter or number

hey :) if i have a variable that is example=lewisdenny(copywrite symbol) so its not a nomal letter but a symbol, how can i remove everything in the varible that isnt letter or number thanks :) and as a side little question do you know how to remove .zip from a file like if i ls... (7 Replies)
Discussion started by: lewisdenny
7 Replies

12. Shell Programming and Scripting

Change case preserving the same case

how can i do a case insensitive search/replace but keep the same case? e.g., i want to change a word like apple-pie to orange-cake but for the first word if the first letter of the keyword or the letter after the - is capitalised i want to preserve that e.g., if the before is: ... (5 Replies)
Discussion started by: vanessafan99
5 Replies

13. Shell Programming and Scripting

Change first letter of a word from lower case to upper case

Hi all, I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like . ; : ! ?I found the following command sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies

14. Shell Programming and Scripting

Grep command

grep -i -f panel_genes.txt hg19_refGene.txt > match.txt seems to be pulling names the do not exist in the input file (panel_genes.txt) - the output is attached as well (match.txt) For example, RNF185 or ZNF146 are not genes in the input. I am trying to match the input file genes only and am... (9 Replies)
Discussion started by: cmccabe
9 Replies

15. Shell Programming and Scripting

Replace the first letter of each line by a capital

Hi, I need to replace, as the title says, the first letter of each line (when it's not a number) by the same letter, but capital. For instance : hello Who 123pass Would become : Hello Who 123pass Is there a way with sed to do that ? Or other unix command ? Thank you :) (7 Replies)
Discussion started by: ganon551
7 Replies