2
I’m trying to create a command on. Ubuntu bashrc, however I’m having a problem, I’m trying to create a folder with the variable typed when calling the alias, but it’s giving error. When I open the terminal it already asks for the folder name, but I don’t want it, I want to type the command anywhere. What I’m doing wrong?
#comando digitado no terminal
username@username:~$ pasta nome_pasta
Where briefcase is the alias name, and folder name is the variable obtained by read.
If I’m doing this the wrong way what would be the best method to have a command like the one above?
my code is like this:
# arquivo .bashrc
function CreateFolder(){
if [ -n "$USER" ]; then
alias pasta='mkdir $name'
read name
else
echo "Error :/"
fi
}
CreateFolder
thanks in advance for the help.
Thank you, your reply helped me a lot, I didn’t think it would be that easy lol.
– dhelbegor