Veja como resolvi meu problema. Pode não ser o melhor caminho, mas eu precisava de uma solução rápida. Talvez alguém precise disso
#!/usr/bin/bash
function main()
{
[ $# -ne 1 ] && { echo "Usage: $0 file"; exit 1; }
depth1=/a.zip
depth2=/b.zip
depth2_special=/special.zip
depth3=/c.zip
depth4=/d.zip
cat $1 | while read line; do
#Count the number of occurences of / in each line
x='echo $line |awk -F/ '{c += NF - 1} END {print c}''
if [ $x -eq 13 ] ;then echo "The path has 13 / "
ln -sf $depth4 $line
else
if [ $x -eq 12 ] ;then echo "The path has 12 /"
ln -sf $depth3 $line
else
if [ $x -eq 11 ] ; then echo "The path has 11 /"
#If there is no _ in the file path treat it as a special case
underscore='echo $line |awk -F_ '{c += NF - 1} END {print c}''
if [ $underscore -eq 1 ] ; then
ln -sf $depth2 $line
else
ln -sf $depth2_special $line
fi;
else
if [ $x -eq 10 ] ;then echo "The path has 10 /"
ln -sf $depth1 $line
else
echo "Error - the path is not correct"
fi;
fi;
fi;
fi;
done
}
main "$@"