I'm trying to find out how to use the command line to enter no more than three parameters into my program...
It current asks the user to say their username, name and password - which then puts the name, password and date/time of creation into a log file with their username as the doc file - as seen below
function savefile {
# Save to file
if [ -e "$username".log ]; then
echo "Username already exists, returning you to the menu."
sleep 2
clear
menu
else
echo "$fullname" >> "$username".log
echo "$password" >> "$username".log
curdate=$(date +'%d/%m/%Y %H:%M:%S')
echo "$curdate" >> "$username".log
echo "Creating your account"
sleep 2
clear
echo "Account created"
echo
afterBasic
fi
}
Wondering if you guys knows how to do this from the command line? I know i have to use
sh 1 2 3
But that's about it...
Here is the same thing written in Batch, if that also helps...
set OP_username=%1
set OP_fullname=%2
set OP_password=%3
if [%3]==[%9] goto 1
echo %OP_fullname% >> %OP_username%.log
echo %OP_password% >> %OP_username%.log
echo %date% %time% >> %OP_username%.log