Results 31 to 34 of 34
Hi thanks for help again. What i want to do is ask username and print the usernames home directory path. How do i do that?
thanks...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-28-2006 #31Just Joined!
- Join Date
- Aug 2006
- Posts
- 16
scripting
Hi thanks for help again. What i want to do is ask username and print the usernames home directory path. How do i do that?
thanks
- 08-28-2006 #32Just Joined!
- Join Date
- Aug 2006
- Posts
- 16
scripting
Hi there, why doesnt this script work properly?
thanks
Code:#!/bin/sh clear echo "Script File Name: $0 " echo "The arguments are: " for a in $*; do echo $a done if [ $# -lt 2 ] ; then echo "New filename missing" fi clear echo "Enter name of original file" read filename if [ $filename = $1 ] ; then echo "The filename you entered is $filename" fi clear echo "Enter the new name for the file" read filename 2 if [ $filename2 = $2 ] ; then echo "The filename you entered is $filename2" fi echo "Do you want to overwrite the first filename? (y/n)?" read verdict if [ "$verdict" = "y" ] ; then echo "$filename2 >> $filename" mv $filename2 $filename elif [ "$verdict" = "n" ] ; then echo "You have chosen not to overwrite. The script will now exit" exit 0 fi
- 08-28-2006 #33
that should work
you are making the same mistakes all the timeCode:#!/bin/sh clear echo "Script File Name: $0 " echo "The arguments are: " for a in $*; do echo $a done if [ $# -lt 2 ] ; then echo "New filename missing" fi clear echo "Enter name of original file" read filename if [ "$filename" = "$1" ]; then echo "The filename you entered is $filename" fi clear echo "Enter the new name for the file" read filename2 if [ "$filename2" = "$2" ]; then echo "The filename you entered is $filename2" fi echo "Do you want to overwrite the first filename? (y/n)?" read verdict if [ "$verdict" = "y" ]; then echo "$filename2 >> $filename" mv $filename2 $filename elif [ "$verdict" = "n" ]; then echo "You have chosen not to overwrite. The script will now exit" exit 0 fi
if [ $filename = $1 ] ; then
here should be quotas
if [ "$filename" = "$1" ] ; then
and no space between ] and ; would be appriciated
if [ "$filename" = "$1" ]; then
you posted this script ten times!!!!!
- 08-28-2006 #34
hi krist !!
i dont understand......... we are solving your porblems again n again but you are not studying or understanding these a bit ....whats going on..... ????
i am writing again..... we are not going to solve your problems like this.....
no more help form here now......... and no more silly questions.....
read this thread again, each and every given solution....... buy a good book or study the tutorials i linked in earlier thread.................
<=== { casper } ===>It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First


Reply With Quote
