Bash script

#!/usr/bin/env bash
PWD=`pwd`
cd $PWD/$1
dates=`ls`
echo $dates

is this working

So those ^M characters are your problem. Always use an editor like vi to create shell scripts, not a Windows editor like Notepad. To get rid of these, run:

tr -d '\r' < bashScriptTest.sh > bashScriptTest.sh.new
mv bashScriptTest.sh.new bashScriptTest.sh

Not for me.

I suppose that RavinderSingh13 is right: the cause may be the ACK,
but how can I remove IT.
I've tried but I cannot do it

may be root can help you for same.

Thanks,
R. Singh

mirko -
See my post #22 above.

^M means "stop editing your scripts in microsoft notepad". Your script is full of carriage returns that it will take as literal parts of the string. It will look for commands like ls^M, and complain that they don't exist.

tr -d '\r' < wingarbage > unixtext