I try to pass an argument to the function install() but the output is "add" and not my argument. I don't know how to get just the REP when i call the function directory-install(), because for know i have all the phrase "add directory...."
function install () {
echo $1 #output not ok, show "add"
}
function directory-install () {
read -p "enter directory " REP
if cd $REP 2> /dev/null ; then
echo -e "add directory '$REP'\n"
else
mkdir REP
echo -e "creat directory \n"
fi
echo $REP
}
REP=$(directory-install)
echo $REP #output not ok too show "add directory..." but i just want the REP .
install $REP
()afterfunction directory-install?install? (Edit: OP edited their code)f()orfunction f.