LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2012, 08:59 PM   #1
destinytia1
LQ Newbie
 
Registered: Mar 2012
Posts: 6

Rep: Reputation: Disabled
Need Help Please...!!!


Please help about these script... i dont have a problem in option 1. But when it comes to options 2 and options 3 i have.. My questions in # 2 options is, when i choose it, the file contents should translate in upper case . My questions in # 3 options is, when i choose it, the file contents should translate in lower case... ?? what is the prob.. in my script??

Code:
#!/bin/bash
clear

        echo "Menu "

        echo "1. COpy a File using dd command "

        echo "2. Translate file contents to upper case "

        echo "3. Translate file contents to upper case "

        echo "4. Quit"

        echo "Enter ur Choice"

        read Choice

        case $Choice in

           1) echo "Enter File name to copy"
	      read f1

              echo "Enter FIle name"

          read f2

          if [ -f $f1 ]

          then
dd $1 if=$f1 of=$f1.copy

              else

                     echo "$f1 does not exist"

              fi

              ;;
2) echo "Enter the File to be converted to upper case"

             read r1

             if [ -f $r1 ]

             then

                   dd $1 $2 if=$r1 of=$r2.copy conv=ucase

             else

                  echo "$r1 file does not exist"

             fi

             ;;

3)
            echo "Enter File name to move \c"
            read f1
            echo "Enter destination \c "
            read f2
            if [ -f $f1 ]
             then 
                 if [ -d $f2 ]
                 then
                      dd $1 $2 if=$r1 of=$r2.copy conv=ucase
                 fi
             else
                 echo "$f1 does not exist"
            fi
            ;;
         4) 
             echo "Exit......."
             exit;;
        esac

Last edited by destinytia1; 03-05-2012 at 09:01 PM.
 
Old 03-05-2012, 09:27 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
Quote:
what is the prob.. in my script??
Without you telling us what is not working we will not be able to help you easily.
 
Old 03-06-2012, 07:15 AM   #3
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 8
does #4 works correctly?
i think the problem is you didn't follow the standard syntax.why #1 and #4 are in the middle of screen and #2 and #3 aren't.
also post the output of this scrip.that might be helpful.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 05:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration