Sponsored Content
Full Discussion: Alphabetical help.
Homework and Emergencies Homework & Coursework Questions Alphabetical help. Post 302548807 by Ren_kun on Saturday 20th of August 2011 02:00:14 AM
Old 08-20-2011
Okay thanks for your help thus far. Ill sleep over it and see if i can make changes. Possibly ill start again and use case instead. Ill be on tomorrow.

---------- Post updated at 04:00 PM ---------- Previous update was at 12:19 AM ----------

Ive been working on the code and this is what i get so far. Everything works ok it accepts inputs one at a time. However when i want to exit (by pressing 0 and enter) i need to do it twice and it makes 0 the lowest letter. Its not what i want and im sure in the code i made it so it would exit out right after 0 was found and to display the lowest letter.

Code:
"3")
clear
echo Enter capitol alphabetical letters one at a time and press 0 to finish
letter="Z"
if [[ "$letter" < Z || "$letter" == Z ]] && [[ "$letter" > A || "$letter" == A ]] || [[ "$letter2" == 0 ]]; then
        while [[ "$letter" == Z || "$letter" < Z ]] && [[ "$letter" > A || "$letter" == A ]] || [[ "$letter2" == 0 ]]; do
        letter2="Z"
        read letter2
                if [[ "$letter2" < "$letter" ]]; then
                letter=$letter2
                elif [[ "$letter2" == 0 ]]; then
                echo Lowest Letter is $letter
                echo Press enter to continue...
                elif [[ "$letter2" == "$letter" ]]; then
                letter=$letter2
                elif [[ "$letter2" > "$letter" ]]; then
                read letter2
                else
                echo "Invalid Input. Please enter A-Z one at a time finalised by a 0"
                fi

        done
else
echo "Invalid input. Please enter A-Z (capital) one at a time finalised by a 0"
fi
;;


Last edited by Ren_kun; 08-20-2011 at 03:07 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell program for sorting strings in an alphabetical order

Hi, I trying to find the solution for writing the programming in unix by shell programming for sorting thr string in alphabetical order. I getting diffculty in that ,, so i want to find out the solution for that Please do needful Thanks Bhagyesh (1 Reply)
Discussion started by: bp_vanarse
1 Replies

2. Shell Programming and Scripting

alphabetical check

echo $TEMP|grep "" I want to check TEMP is alphabetic or not in both the cases.but in above script i am getting 1($?) if TEMP is in pure lower case or pure upper case.i want to get 0($?) when TEMP would be alphabetic in either cases.pleaaaase help me out..... (4 Replies)
Discussion started by: arghya_owen
4 Replies

3. Shell Programming and Scripting

alphabetical order with out using sort command

hai, how can i sort a file alphabetically without using sort command (6 Replies)
Discussion started by: rahul801
6 Replies

4. UNIX for Dummies Questions & Answers

how to use sed command with alphabetical and spaces?

If have a problem with this command: name="toe der" echo $name | sed -e 's/]//g' it will become: toeder how to make it back to original? (7 Replies)
Discussion started by: elenatec
7 Replies

5. UNIX for Dummies Questions & Answers

How can I list the file under a directory both in alphabetical and in reverse alphabetical order?

How can I list the file under current directory both in alphabetical and in reverse alphabetical order? (1 Reply)
Discussion started by: g.ashok
1 Replies

6. UNIX for Dummies Questions & Answers

Alphabetical sort for multi line records contains in a single file

Hi all, I So, I've got a monster text document comprising a list of various company names and associated info just in a long list one after another. I need to sort them alphabetically by name... The text document looks like this: Company Name: the_first_company's_name_here Address:... (2 Replies)
Discussion started by: quee1763
2 Replies

7. Shell Programming and Scripting

[SHELL] Userlist alphabetical order

Hi everyone! I am new to the forum and have recently started working with Linux. Quick question, I want a user list in alphabetical order as the output of a shell script. Who can help me!? Thanks! From the netherlands ;) (5 Replies)
Discussion started by: dennisbest85
5 Replies

8. UNIX for Dummies Questions & Answers

Script to list applications in alphabetical order

I've looking over a script for work and I've had a problem with the script not listing the files in alphabetical order. To look up PIDs for apps, it would be beneficial to have them listed in that order. Here is what I've been reviewing. #!/usr/bin/perl $str = sprintf "%4s %-40s", "PID",... (7 Replies)
Discussion started by: whysolucky
7 Replies

9. Shell Programming and Scripting

Sorting lines between patterns in alphabetical order

Hi, need help in sorting lines between strings "<section status = “ole-service”>" and "</section>" in alphabetical order, based on the text in red. Hoping for an AWK or SED solution. Thank you. ... <section status = “ole-service”>... <p service = "OOO">XZZ</p> <p service = "AAA">AAA... (3 Replies)
Discussion started by: pioavi
3 Replies

10. Homework & Coursework Questions

Script program to count only alphabetical characters

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script program to count the ONLY the number of alphabetic characters stored in the shell variable... (1 Reply)
Discussion started by: kofine05
1 Replies
RE(1)							      General Commands Manual							     RE(1)

NAME
re - programm to conver russian texts between different encodings SYNOPSIS
re <infile><outfile><infrmt><outfrmt><f|b|s><u|l|s> DESCRIPTION
This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. re is a program that converts russian texts between encodings. OPTIONS
The easiest way to convert some file into readable form (KOI-8), just type this: re <SourceFile> <DestFile> ? K where : <SourceFile> - unreadable file <DestFile> - resulting file ? - tells RE that source codepage is unknown and RE should analyze the file and determine the source codepage K - tells RE that destination codepage is KOI-8 Note: If you know, what is source codepage, you may use it instead of "?" option. For example, you want to convert letter.txt file which was written in Win you know, that this file is in 1251 codepage: re letter.txt letter2.txt W K Now examine the letter2.txt - you should see russian symbols in KOI-8. Here is the know codepages list and their abbreviatures: W - Windows 1251 "_" - _xxe D - Dos "%" - %hex K - KOI-8 "\" - 'hex L - Latin G - Graph_win I - Iso "<" - <binhex> H - HEX + - +UTF7- S - ShiftKbrd C - C_MIC M - Mac Y - Y_c16 A - AFF Z - Z_c32 O - Odd(UTF8_1) F - F(UTF8_2) B - Base64 P - Pict E - Express N - N_Estl T - T-Html V - V_Vpp855 U - User X - X_sp "-" - uue J - J_diff Other options are: [-v][-E|-R|-N][-e|-s] -v - tells what is processing -n - don't tells what is processing (default) -E - converts all p,H from Russian to English -R - converts all p,H from English to Russian -N - lets all p,H Russian or English as in text (default) -e - converts all symbols 0x80 - 0xFF -s - converts only 64 symbols of Russian Alphabet (default) AUTHOR
This manual page was written by Aigars Mahinovs <aigarius@debian.org>, for the Debian GNU/Linux system (but may be used by others). March 21, 2000 RE(1)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy