Displaying uppercase in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Displaying uppercase in shell script
# 1  
Old 09-29-2010
Displaying uppercase in shell script

Hi,

The user value y/n should get display in upper case
Code:
printf "$FBOLD\nDo you want to continue?[Y/N]: $FREG"

Do you want to continue?[Y/N]: y

Though user enters in smaller case y, but it should get display in uppercase Y

How it can be done ?

With Regards

Last edited by vbe; 09-30-2010 at 05:05 AM.. Reason: code tags...
# 2  
Old 09-29-2010
If your teminal supports it try:
Code:
stty olcuc

This for the echo of uppercase letters when lowercase is typed.
WARNING: be sure to set it back stty -olcuc
# 3  
Old 09-30-2010
Quote:
Originally Posted by milink
Hi,

The user value y/n should get display in upper case
Code:
printf "$FBOLD\nDo you want to continue?[Y/N]: $FREG"

Do you want to continue?[Y/N]: y

Though user enters in smaller case y, but it should get display in uppercase Y

How it can be done ?

With Regards
If u are using Bash, Please try this one ..
Code:
user_option=`echo $user_input | tr '[:lower:]' '[:upper:]'`

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Displaying Column header in shell script

Hi, I need to display specific columns using select statement and spooled to a file and sending it as e-mail. But i am not seeing column header in my output even i use SET HEADING ON.//PREDEFINED LOGIN DETAILS ${ORACLE_HOME}/bin/sqlplus -s ${DB_LOGIN}/${DB_PASSWD} <<EOF SET FEEDBACK OFF SET... (1 Reply)
Discussion started by: pvelmuru
1 Replies

2. Shell Programming and Scripting

Shell for displaying specific records from a line.

Input file. GMDCOM.27936 : Process Request <36812974> GMDCOM.27936 : Process Request <36812985> GMDCOM.27936 : Process Request <36812986> GMDCOM.27936 : Process Request <36812987> GMDCOM.27936 : Process Request <36812996> GMDCOM.27936 : Process Request <36812998> GMDCOM.27936 : Process... (14 Replies)
Discussion started by: ghosh_tanmoy
14 Replies

3. UNIX for Dummies Questions & Answers

Shell Script for displaying the line till the target word

" Script for display sentences with special character" Hi, Could any one share a command how to display a line until my target word. For ex: My file has the content as: select * from db_wrk where col1 < col2 insert into table_name values('1','2','tst','wrk','dev','prod') My target... (10 Replies)
Discussion started by: Kalaiselvi66
10 Replies

4. Shell Programming and Scripting

Displaying trailing spaces in a filename; Korn Shell

Korn Shell on AIX 6.1 In one of our directories, we have 2 files with same names but one of those file's name has 3 trailing spaces ls *.ctl rconf.ctl rconf.ctl #this file has 3 trailing spaces Is there any way we could display these trailing spaces ? (6 Replies)
Discussion started by: polavan
6 Replies

5. Shell Programming and Scripting

displaying an image - BOURNE SHELL

i am new to bourne shell, and i am making this program that checks if any .bmp files exist in the current directory, then if it does, it displays the image... please help!! thanks in advance..... (3 Replies)
Discussion started by: bshell_1214
3 Replies

6. Shell Programming and Scripting

how to convert a shell script to a php script for displaying next word after pattern match

I have a shell script which I made with the help of this forum #!/bin/sh RuleNum=$1 cat bw_rules | sed 's/^.*-x //' | awk -v var=$RuleNum '$1==var {for(i=1;i<=NF;i++) {if($i=="-bwout") print $(i+3),$(i+1)}}' Basically I have a pages after pages of bandwidth rules and the script gives... (0 Replies)
Discussion started by: sb245
0 Replies

7. Shell Programming and Scripting

execute script without displaying child script messages

Hi i have a script which is calling another script. But my child script is displaying some values. sample script. export LOG_File=/log $/Project/Scripts/emit.ksh mv inner_test.ksh /log/test.ksh echo 'Success' here emit.ksh is doing some processing .and echoing some values. what i... (2 Replies)
Discussion started by: kam786sim
2 Replies

8. Shell Programming and Scripting

Help with Shell Script displaying Directories

I am new to shell programming and have an assignment question which requires me to list the contents of the present working directory in 4 column format and highlight any subdirectories. It then requires me to develop the shell script to accept a directory name as a positional parameter (if no... (11 Replies)
Discussion started by: cjnd1988
11 Replies

9. Shell Programming and Scripting

Displaying Array Elements in Shell Scripts

Hi All, I am using the following piece of script to print all the array elements in a script by name compare.sh: 31 len=${#array }; 32 j=0; 33 #echo "The length of the array is : $len" 34 while ; do 35 temp=${array} 36 echo "$temp" 37 let $j++ 38 done But I am getting the... (2 Replies)
Discussion started by: ananddr
2 Replies

10. Shell Programming and Scripting

Displaying Script command with output

How do you display the script command for a particular output result? Is there an editor that will allow for an echo or sysout of the script that causes an output result? We have hundreds of lines in the script, which we would like to see along with the output, and don't want to have to put in... (5 Replies)
Discussion started by: JeDi
5 Replies
Login or Register to Ask a Question