Sponsored Content
Top Forums Shell Programming and Scripting how to convert user input to uppercase Post 302480440 by milink on Wednesday 15th of December 2010 01:32:35 AM
Old 12-15-2010
Hi,


U1=`echo siva | tr '[a-z]' '[A-Z]'`
U2="${U1}V"
Assigning value to variable (U1, U2) as shown above is not working in the batch script. How to write the same in batch script ?

With Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How convert lowercase or uppercase

It will only accept one argument where it should be upper or lowercase. if user choose to convert filnames to upper case than it should convert to upper or vice versa. if no action taken by the user then should not do anything any of the files in the current directory. (5 Replies)
Discussion started by: Alex20
5 Replies

2. Shell Programming and Scripting

sed help to convert from lowercase to uppercase and vice versa!

Hello, can sed be used to convert all letters of a file from uppercase to lowercase and vice versa?i know tr command can be used but with sed is it possible? i came up with this :- sed 'y///' file1 actually the above command is also not working! Please help me. Thanks in advance :) (6 Replies)
Discussion started by: salman4u
6 Replies

3. UNIX for Dummies Questions & Answers

Convert string to uppercase

i have this piece of small code that checks for *.CSV files. NUMFILES=`ls -1 *.CSV | wc -l` for filename in $(ls -1 *.CSV) do ... done it works only if the files has an uppercase of *.CSV extension. however, when there is a file of the same type but has lowercase *.csv... (1 Reply)
Discussion started by: wtolentino
1 Replies

4. Shell Programming and Scripting

Convert the first letter of each line to uppercase

Hi, I have the following file: /* ----------------- ADP2DAILY_Box ----------------- */ insert_job: ADP2DAILY_Box job_type: b owner: mbprwork permission: gx,wx date_conditions: 1 days_of_week: mo,tu,we,th,fr exclude_calendar: mtg_holidays start_times: "1:00" description: "Process Daily... (4 Replies)
Discussion started by: ramky79
4 Replies

5. Shell Programming and Scripting

Convert lowercase to uppercase

listprocs.sh contains ps -ef | grep "swikar" 1) Write a shell script to convert an input file to all upper case. Name your shell script toupper.sh. Hint: tr ' ' ' ' will convert all lower case letters to upper case To use your script, try the following command: cat... (1 Reply)
Discussion started by: swikar
1 Replies

6. Shell Programming and Scripting

convert to uppercase in specific table

Hi All, I'm a newbie here, i'm just wondering is it possible to convert into uppercase the records in specific field? ex. table name = mytable field1 field2 field3 abd erfdF fdsfdsfsd how can i convert into uppercase the field2 using sybase? Please advise, ... (2 Replies)
Discussion started by: nikki1200
2 Replies

7. Shell Programming and Scripting

Validating uppercase/lowercase of user input with perl compared to unix folders

Hi, I need to copy files from a source directory to a destination directory in unix. I'm using the file::copy for the actual copy. The problem is that the source and dest directories are supplied by different users, who might type the name of the directories in various combinations of lower... (6 Replies)
Discussion started by: Furou
6 Replies

8. Shell Programming and Scripting

Find Files and then convert them to Uppercase

Hi All, So I'm new to scripting and I've been put in a position to convert a bunch of files with specific extensions in a folder and all its subfolders to uppercase including their extension. I figure so far I could do something like this: ... ... and then input $line into another bash... (12 Replies)
Discussion started by: ideal2545
12 Replies

9. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

10. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies
TOUPPER(3)						     Linux Programmer's Manual							TOUPPER(3)

NAME
toupper, tolower, toupper_l, tolower_l - convert uppercase or lowercase SYNOPSIS
#include <ctype.h> int toupper(int c); int tolower(int c); int toupper_l(int c, locale_t locale); int tolower_l(int c, locale_t locale); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): toupper_l(), tolower_l(): Since glibc 2.10: _XOPEN_SOURCE >= 700 Before glibc 2.10: _GNU_SOURCE DESCRIPTION
These functions convert lowercase letters to uppercase, and vice versa. If c is a lowercase letter, toupper() returns its uppercase equivalent, if an uppercase representation exists in the current locale. Oth- erwise, it returns c. The toupper_l() function performs the same task, but uses the locale referred to by the locale handle locale. If c is an uppercase letter, tolower() returns its lowercase equivalent, if a lowercase representation exists in the current locale. Oth- erwise, it returns c. The tolower_l() function performs the same task, but uses the locale referred to by the locale handle locale. If c is neither an unsigned char value nor EOF, the behavior of these functions is undefined. The behavior of toupper_l() and tolower_l() is undefined if locale is the special locale object LC_GLOBAL_LOCALE (see duplocale(3)) or is not a valid locale object handle. RETURN VALUE
The value returned is that of the converted letter, or c if the conversion was not possible. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +-------------------------+---------------+---------+ |Interface | Attribute | Value | +-------------------------+---------------+---------+ |toupper(), tolower(), | Thread safety | MT-Safe | |toupper_l(), tolower_l() | | | +-------------------------+---------------+---------+ CONFORMING TO
toupper(), tolower(): C89, C99, 4.3BSD, POSIX.1-2001, POSIX.1-2008. toupper_l(), tolower_l(): POSIX.1-2008. NOTES
The standards require that the argument c for these functions is either EOF or a value that is representable in the type unsigned char. If the argument c is of type char, it must be cast to unsigned char, as in the following example: char c; ... res = toupper((unsigned char) c); This is necessary because char may be the equivalent signed char, in which case a byte where the top bit is set would be sign extended when converting to int, yielding a value that is outside the range of unsigned char. The details of what constitutes an uppercase or lowercase letter depend on the locale. For example, the default "C" locale does not know about umlauts, so no conversion is done for them. In some non-English locales, there are lowercase letters with no corresponding uppercase equivalent; the German sharp s is one example. SEE ALSO
isalpha(3), newlocale(3), setlocale(3), towlower(3), towupper(3), uselocale(3), locale(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2017-09-15 TOUPPER(3)
All times are GMT -4. The time now is 06:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy