Нужно сделать так, чтобы cgi-скрипт на bash переводил синволы из русского в транслит. Вот тестовый скрипт:
#!/bin/bash
echo "Content-Type: text/html"
echo ""
echo "Тест"|./trans.sed
#export
При попытке провести транслитизацию, в логах apache появляются ошибки:
old:/var/www# tail /var/log/apache/error.log
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
printf: write error: Broken pipe
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
printf: write error: Broken pipe
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
/bin/sed: file ./trans.sed line 2: strings for `y' command are different lengths
old:/var/www#
Сам транслитизатор:
old:/var/www# cat ./trans.sed
#!/bin/sed -f
y/абвгдеёжзийклмнопрстуфхцчшыэюя/abvgdeöžzijklmnoprstufhcčšyeüä/
s/щ/šč/g
s/ъ/'/g
s/ь/'/g
y/АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЫЭЮЯ/ABVGDEÖŽZIJKLMNOPRSTUFHCČŠYEÜÄ/
s/Щ/Šč/g
s/Ъ/'/g
s/Ь/'/g
в чём ошибка