Shell Script Help Plz


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Shell Script Help Plz
# 1  
Old 10-05-2008
Shell Script Help Plz

#######################################################################
#
#This script will perform the menu such as : list file, change catalog,
#file check,
#
#This script was written in UNIX Shell Programming Language
#
########################################################################
menu() {
echo "This script performs the following fucntions:"
echo
echo " 1-List files (Directory)"
echo " 2-Change Directory"
echo " 3-File Check"
echo " 4-Copy File"
echo " 5-Remove File"
echo " 6-Change File Name"
echo " 7-Input File To Screen"
echo " 8-Output File To Printer"
echo " 9-Users Logged In To The Computer"
echo " 10-Who Am I"
echo " 11-Current Directory"
echo " 12-Make A Directory"
echo " 13-Delete Empty Directory"
echo " q-Quit The Menu"
echo
echo " Choose A Function (1/../13 or q for Quit and Press <RETURN> key:"
}
menu
read INPUT
while [ $INPUT != q ]
do
case $INPUT
in
1) menu
echo "Enter directory you want to list"
read DIR
if [ -d $DIR ]
then
cd $DIR
echo "Here is list of the file under $DIR directory"
ls
else
echo "Your input is invalid directory"
fi
echo "Please enter the input"
read INPUT
sleep 2
;;

if someone can plz help me. I could only make first one to work and all of them have to work plz
thank you.
# 2  
Old 10-05-2008
Is this for a homework assignment?
# 3  
Old 10-05-2008
yes it is but i cant figure out how to do it. if u could help me plz
# 4  
Old 10-06-2008
Thread closed. Please read the rules.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

error in shell script while returning values-- urgent issue plz help.

Hi, I have initailized a varaible EBID as typeset Long EBID=0 i am calculating value of EBID using certian formula as below: (( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE )) return $CURR_EBID The output is as below: + (( CURR_EBID=... (6 Replies)
Discussion started by: kasanur
6 Replies

2. Homework & Coursework Questions

Plz Help Me in This question in Shell Programming

2- Write a bash shell script filestatic. The script should examine the number files in directories given as arguments (parameters) to this script. a. if one argument is given, the script should count and report the number of files in this directory. Only regular files should be counted, not... (1 Reply)
Discussion started by: tahseen_22334
1 Replies

3. Shell Programming and Scripting

plz help normal doubt abt shell script

How to print a only files and not directories in a path. for exam :a user consists both files and directoris in his path. i have to write a script to display only files not dirctories. and only dirctories not files. Advance thanks to forum members.:) (5 Replies)
Discussion started by: sivaranga001
5 Replies

4. Shell Programming and Scripting

i'm new to shell can handle this script for me plz

Write a shell script named displayargs that prints FOUR lines. The first line tells the name that was used to invoke the script, the second line tells how many parameters there were, the third line tells what the last parameter was, and the fourth line tells what the first parameter was. For... (8 Replies)
Discussion started by: kedah160
8 Replies

5. Shell Programming and Scripting

Plz correct my syntax of shell script

Dear all I am still bit new in shell script area.I am writing down a shell script which I guess somewhere wrong so please kindly correct it. I would be greatful for that. What I actually want from this shell script is that it will move all the files one by one to another server which can be... (2 Replies)
Discussion started by: girish.batra
2 Replies

6. Shell Programming and Scripting

shell script to call other files..plz help

Hi all, I have a number of shell script,perl script.. etc in a directory,which i need to execute in some order.Now i need to create a script to call all these files in that order..so that the new script will execute all the files one by one....plz help this is urgent. Thanks In advance Anju (3 Replies)
Discussion started by: anju
3 Replies

7. Shell Programming and Scripting

plz help me by creating required shell script

Dear all I am new to shell script. And this is my first post to this site as well as this forum. I would like to tell this forum that I require shell script, which is regarding transfers of files from a specific directory in a server A to server B on a specific directory through sftp command.... (5 Replies)
Discussion started by: girish.batra
5 Replies

8. Shell Programming and Scripting

Shell script to find out 2 last modified files in a folder..PLZ HELP!!!!!!!!!

hi all, I need to find out the last 2 modified files in a folder.There is some way by which,we can check the timestamp and find out..??please help this is urgent. Thanks in Advance Anju (3 Replies)
Discussion started by: anju
3 Replies

9. UNIX for Dummies Questions & Answers

What is the output of that Shell Scripts Plz tell me

tr "" "" | sort | awk 'length($0)>0' | uniq -c (1 Reply)
Discussion started by: brain_full
1 Replies

10. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies
Login or Register to Ask a Question