they call.me I
Member
- Feb 6, 2015
- 23
- 11
I have a project due 7th march 2016. I have to create an Atm script with three users with their different data and password. If you have idea please help. thank you for reading.
I have a project due 7th march 2016. I have to create an Atm script with three users with their different data and password. If you have idea please help. thank you for reading.
su -c "Your command right here" -s /bin/sh username
#!/bin/bash
if [ $UID -eq 0 ]; then
user=$1
dir=$2
cd "$dir"
exec su "$user" "$0" "$@"
fi
echo "This will be run from user $UID"
Okay so you have neither responded to Stefano nor I, Noel correctly.Thanks for your reply let me show u were have reached my only problem is inserting all the three users with ther different accounts
find /etc/ -type f -iname "*.sh" | xargs cat | less
thanks its now workingOkay so you have neither responded to Stefano nor I, Noel correctly.
Since its a homework, you also have to read.
You need to have functions to perform specific tasks.
You shall need switch statements to control your program execution.
for learning, run the following as root.
simply learn how the bash functions are written and invoked.Code:find /etc/ -type f -iname "*.sh" | xargs cat | less
BASH Programming - Introduction HOW-TO
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html
From Power Up To Bash Prompt
http://tldp.org/LDP/abs/html/index.html [ read after finishing the above guides]
Goodluck
i was able to solve it thankspaste text not screenshot