Bash Script: Trouble unable to run


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash Script: Trouble unable to run
# 8  
Old 07-20-2009
Code:
       6) echo "Files in `pwd`"; ls -l ; echo "Press any key ..."; read;;

# 9  
Old 07-20-2009
Wow, that did it! Thanks to all for you help. Only other question I have is when I run the `cal` command, it does not appear properly on the screen. Any ideas?

Thanks,

Rob
# 10  
Old 07-20-2009
Quote:
Originally Posted by rchirico
Wow, that did it! Thanks to all for you help. Only other question I have is when I run the `cal` command, it does not appear properly on the screen. Any ideas?

Thanks,

Rob
Code:
       1) cal $(date +%Y); echo "Press any key ..."; read ;;



---------- Post updated at 06:56 PM ---------- Previous update was at 06:23 PM ----------

here's an alternative way of building menu - no manual menu building:
Code:
#!/bin/ksh
#!/bin/bash
# Cool Script for Weekly Assignment 2 (#3) that creates a menu to act as a ui
# and run some popular commands.
clear

PS3='Please enter your menu choice> '

oldIFS=$IFS
IFS='
'
menu='Display Calendar for current year
Show files in your home directory
Launch vi to create/edit a file
Shutdown system now
Shutdown system in 5 minutes
Show files in current directory
Exit'

while :
  do
     clear
     echo "**************************************************"
     echo " Main Menu of Linux User Interface"
     echo " Today's Date and Time: " `date`
     echo "**************************************************"



     select choice in ${menu}
     do
       case $REPLY in
         1) cal $(date +%Y); echo "Press any key ..."; read ;;
         2) echo "Files in `$HOME`" ; ls -l ; echo "Press any key ..." ; read ;;
         3) vi ;;
         4) clear
            echo " "
            echo " "
            read -p "Are you sure you want to shut down? - Y/N: " choice
            if [[ "$choice" = 'Y' ]] ; then
            sudo shutdown -h now
            fi
            clear ;;
         5) sudo shutdown -h now ;;
         6) echo "Files in `pwd`"; ls -l ; echo "Press any key ..."; read;;
         7) exit 0 ;;
         *) echo "Invalid selection!!!  Please select choice 1,2,3,4,5,6, or 7";
            echo "Press any key ..." ; read ;;

      esac
      REPLY=''
    done
done
IFS=$oldIFS

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to run the script on remote machine Using Expect script

Not able to execute the file in remote host using except utility I am automating the SFTP keys setp process: So i created the expect script for controlling the output of shell below is my main code: Code: #!/usr/bin/expect set fd set password close $fd set df set app close $df... (1 Reply)
Discussion started by: Manoj Bajpai
1 Replies

2. Homework & Coursework Questions

Linux/UNIX Bash Shell Script trouble help needed!!

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 2. Shell Bash Script 3. !/bin/bash if echo no directory then mkdir -p /home/AC_Drywall elif ; then echo "$dir already exist" fi (4 Replies)
Discussion started by: TomFord1
4 Replies

3. Shell Programming and Scripting

Having trouble with My Bash Script, need Help debugging

Hello Friends I am having trouble with my script below. I will describe the problems below the code box. I am hoping that some of the experts here can help me. #!/bin/bash #========================================================================================================= # Rsync File... (8 Replies)
Discussion started by: jdavis_33
8 Replies

4. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

5. Shell Programming and Scripting

php file unable to run shell script with arguments

echo $result=exec("./permit.sh".$_FILES); pls suggest some other method to run shell script in php .:wall::mad: (0 Replies)
Discussion started by: upvan111
0 Replies

6. SuSE

Unable to Run a script at startup in suse

Hi I have a script myscript.sh that needs to be run whenever the server boots. The script is actually logging Syslog-ng messages to sql server. I need to lauch it at startup I have copied the script in etc/init.d i have also added the link ln -s /etc/init.d/syslog-ng-mssql-pipe.sh... (5 Replies)
Discussion started by: SystemEng
5 Replies

7. Shell Programming and Scripting

Quoting issue: Trouble with bash strings in script

I can do this on the command line: sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\ select second_id from borrower where btype like '%wsd%' " I can also just leave the SQL at the end intact on one line .... ... However, when I throw this in a script like: $SQSH -o... (4 Replies)
Discussion started by: Bubnoff
4 Replies

8. Shell Programming and Scripting

unable to run mono app using .sh script

I did a search for this problem but couldn't find any specific answers to my problem. We have a .NET application compiled in SharpDevelop for Mono which we want to execute with a .sh shell script on Ubuntu. When we execute the script nothing happens meaning the application's visual interface... (0 Replies)
Discussion started by: JacquesB
0 Replies

9. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

10. Shell Programming and Scripting

unable to run a script

thi is (10 Replies)
Discussion started by: angelina
10 Replies
Login or Register to Ask a Question