cat input|while IFS= read -r -n 1 A;do
if [ "${A}" == "/" ];then
echo -n "\\"
elif [ "${A}" == "\\" ];then
echo -n "/"
fi
done
Solution is working as expected but compiler says output is different
tusharpm
#2
I think the last thing left is to print a new-line character.
Maybe try an echo
in the end.