Не бойтесь, что это жесткое заявление sed
. Но она должна уважать каскадирование. Вот она в одной строке:
sed -e 's/,/|/g;:a;s/{\([^{}]*\)|\([^{}]*\)}/{\1,\2}/g;ta;s/{\([^{}]*\)}/<\1>/g;ta;:b;s/<\([^<>]*\)>/{\1}/g;tb' file
Вот комментированная версия:
sed -e '
s/,/|/g; #replaces all commas (,) with pipes (|)
:a; #sets a label called a
s/{\([^{}]*\)|\([^{}]*\)}/{\1,\2}/g; #replaces {a|b|c} with {a,b|c}
ta; #go back to the label `a` and repeat the
#prevous part until there is nothing more
#to replace: when {a|b|c} became {a,b,c}
s/{\([^{}]*\)}/<\1>/g; #replace {...} with <...>
ta; #go back to label a again until all {} are
#replaces by <>
:b; #create a new label called b
s/<\([^<>]*\)>/{\1}/g; #replace <...> back to {...}
tb; #and back to label b to repeat the previous
#part
' file
С тем, что я получил желаемый выход.
-121--129064-Все службы необходимо загрузить и проанализировать перед их запуском, и ваша служба недоступна на ранней стадии процесса загрузки, когда systemd анализирует все службы, поскольку она находится в другом разделе.
Чтобы решить эту проблему, сохраните локальные услуги в /etc/systemd/system/
или создайте пакет для вашего распространения и поместите их в /usr/lib/systemd/system/
The following packages are in a mess due to serious problems during
installation. They must be reinstalled for them (and any packages
that depend on them) to function properly:
python-lxml pythonic binding for the libxml2 and libxslt libraries
python-aptdaemon Python 2 module for the server and client of aptdaemon
python3-uno Python-UNO bridge
python-dbus simple interprocess messaging system (Python interface)
python-defer Small framework for asynchronous programming (Python 2)
python-gi Python 2.x bindings for gobject-introspection libraries
python3-speechd Python interface to Speech Dispatcher
python3-xdg Python 3 library to access freedesktop.org standards
python-aptdaemon.gtk3widgets Python 2 GTK+ 3 widgets to run an aptdaemon clien
python3-requests elegant and simple HTTP library for Python3, built for hu
python-lazr.uri library for parsing, manipulating, and generating URIs
python3-crypto cryptographic algorithms and protocols for Python 3
python3-louis Python bindings for liblouis
python-cairo Python bindings for the Cairo vector graphics library
python-keyring store and access your passwords safely
python-gobject-2 deprecated static Python bindings for the GObject library
python3-chardet universal encoding detector
python3-lxml pythonic binding for the libxml2 and libxslt libraries
python3-cairo Python 3 bindings for the Cairo vector graphics library
python-gtk2 Python bindings for the GTK+ widget set
python3-dirspec Python User Folders Specification Library
python-chardet universal character encoding detector
python-cupshelpers Python modules for printer configuration with CUPS
dh-python Debian helper tools for packaging Python libraries and ap
python-crypto cryptographic algorithms and protocols for Python
python-dirspec Python User Folders Specification Library
python3-six Python 2 and 3 compatibility library (Python 3 interface)
python-lockfile file locking library for Python
python-apt Python interface to libapt-pkg
python3-oauthlib generic, spec-compliant implementation of OAuth for Pytho
python3-xkit library for the manipulation of xorg.conf files (Python 3
python-httplib2 comprehensive HTTP client library written for Python
python-debian Python modules to work with Debian-related data formats
python3-urllib3 HTTP library with thread-safe connection pooling for Pyth
python-lazr.restfulclient client for lazr.restful-based web services
python-configglue Glues together optparse.OptionParser and ConfigParser.Con
python-launchpadlib Launchpad web services client library
Таким образом, сообщение ясно, вы должны переустановить все эти пакеты, а затем перенастроить все остальное:
sudo apt-get --reinstall install python-lxml python-aptdaemon python3-uno python-dbus python-defer python-gi python3-speechd python3-xdg python-aptdaemon.gtk3widgets python3-requests python-lazr.uri python3-crypto python3-louis python-cairo python-keyring python-gobject-2 python3-chardet python3-lxml python3-cairo python-gtk2 python3-dirspec python-chardet python-cupshelpers dh-python python-crypto python-dirspec python3-six python-lockfile python-apt python3-oauthlib python3-xkit python-httplib2 python-debian python3-urllib3 python-lazr.restfulclient python-configglue python-launchpadlib
А затем сконфигурируйте/перенастройте все пакеты:
sudo dpkg --configure -a
sudo apt-get install -f
О, я также рекомендую вам обновить до надежных, чтобы вы могли использовать последнюю версию всех пакетов.
Предположим, что в каталоге:
file_name=`ls wip_folder` есть только один файл:
file_name=`ls wip_folder`. log_file="${log_file}.log".