if test $var4 -ne $var5
echo "next "$var2" prog"
if test "$var1$var2" = "$var3.java"
cat ../defaults/javadefaultfile.txt >> ./Javaprogs/$var1.java/$var1.java
if test "$var1$var2" = "$var3.c"
cat ../default/cprogdefaultfile.txt >> /Users/la/cprogs/$var1.c/$var1.c
if test "$var1$var2" = "$var3.sh"
cat /Users/a/defaults/shdefaultfile.txt >> ./$var1/$var1.sh
the part in red contains the problem, the `sudo su` command does prompt me, but once I enter my passwd i change prompt as normal. I can type, but no commands are recognized and ctrl-c does nothing but enter a new blank line. Any help would be appreciated.
what you are trying to do is run the commands in red with root permissions?
when you wrote "sudo su" what happens is that the "su" command runs with root permissions and opens you a new shell. if you quit this shell your script will finish it execution.
you should use the sudo command for each command you want to run with root permissions.