Я пишу скипт, который должен переходить в следующую по списку директорию
!#/bin/sh
thisname=`/bin/pwd| tr "\/" "\n" |tail -n1`
cd ..
parentpath=`/bin/pwd`
nextpath=`find ./ -type d| grep -A1 $thisname|tail -n1`
cd "'$parentpath/$nextpath'"
Запускаю
user@Host ~/test/test(1) $ source cdnext.sh
bash: cd: '/home/user/test/./test(2)': Нет такого файла или каталога
вручную все работает:
user@Host ~/test $ cd '/home/user/test/./test(2)'
user@Host ~/test/test(2) $
Как сделать, чтобы заработало?