Некоторая любовь к Баш; Назовите это как хотите. Я использовал thescript.sh
#!/bin/bash echo '[General]' echo 'StartWithLastProfile=1' echo '' n=0 for file in * ; do if [ -d $file ] ; then if [[ "$file" =~ .+\.(.+) ]] ; then echo "[Profile$]" echo "Name=$" echo "IsRelative=1" echo "Path=$" if [[ $ == default ]] ; then echo "Default=1" fi echo "" let n++ fi fi done
использование
Во-первых, поместите его в свой каталог профилей mozilla (например, ~ / .mozilla / firefox для меня).
chmod +x thescript.sh ./thescript.sh ./thescript.sh > profiles.ini
Выход
nex@Computer:~/.mozilla/firefox > ./thescript.sh [General] StartWithLastProfile=1 [Profile0] Name=default IsRelative=1 Path=03k202kd.default Default=1 [Profile1] Name=test IsRelative=1 Path=a023lkdl.test nex@Computer:~/.mozilla/firefox > ./thescript.sh > profiles.ini