Sponsored Content
Full Discussion: help please
Top Forums Shell Programming and Scripting help please Post 13310 by ruffenator on Tuesday 15th of January 2002 03:48:18 PM
Old 01-15-2002
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
 
CHSH(1) 							   User Commands							   CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy