change directory is not working through script but working directly on machine
I am trying to run this command through script doing ssh and it is only executing cd command.
cd $(ls | tail -1)
While it is working directly on the machine.