change directory is not working through script but working directly on machine
13:04 06 May 2020

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.

linux shell unix scripting