![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
help please
hi ya just needed some help to validate this badboy
what i need is that the user enters a directory then it'll change to that and then print the directory. if not a valid directory the user is aksed whether they want another go, if yes they have another go, if not they menu programme reruns again. please help me ! ta "3") 42 43 clear 44 45 print "this will change your current working directory" 46 47 print "please enter a directory to change to" 48 49 read dir junk 50 51 if test -d $dir 52 53 then 54 55 clear 56 57 echo "The directory $dir does exist" 58 59 echo "I will now change to that directory" 60 61 cd $dir 62 print -n "You are now in the" "directory :" 64 65 pwd 66 67 echo "Please push enter to continue" 68 69 read 70 71 /home/bf01/bf01iaru/projcp/proj/ 72 73 else 74 75 if test -f $dir 76 77 then 78 79 clear 80 81 echo "$dir is a file not a directory" 82 83 else 84 85 clear 87 echo "$dir does not exist" 88 89 echo "Please try again" 90 91 sleep 3 92 93 /home/bf01/bf01iaru/projcp/proj 94 95 fi 96 97 fi 98 99 ;; 100 |
|
||||
|
thanks but that doesn't answer my question any other help would be great. remember if the input isnt ma directory then they are given the question do you want another try? if yes they have another go if no then it reloads the project again.
ta |
|
|||||
|
Yes, ruffenator has published many homework problems this week and we've had to spend time chasing them down and deleting them (wasting time).
Homework problems on the boards are against board rules and help keep the forums professional, without ethical problems. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|