I am trying to use ls , cat etc commands inside a bash function
Report()
{
ls $1 | sort -u
}
Report()
I am getting ls: command not found error when I run the function
Is it not possible to use bash commands inside bash function?
I could see examples where only echo is used inside the function
$PATH
when it runs?PATH
? If so, you probably broke it. See this question, especially tripleee's answer.Report(){ ls "${1:-.}" | sort -u; }; Report;