Outils pour utilisateurs

Outils du site


start

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
start [2019/07/09 12:12] tiercestart [2019/07/09 12:23] – external edit 127.0.0.1
Ligne 1: Ligne 1:
 ====== Pour remplacer des trucs de Wiki.js ====== ====== Pour remplacer des trucs de Wiki.js ======
 +
 +    sed -i.bak2 's/<!-- TITLE: \([^>]*\) -->/====== \1 ======/g' cube.txt
 +    sed -i.bak2 's/<!-- SUBTITLE: \([^>]*\) -->/===== \1 =====/g' cube.txt
 +
 +Suite à la conversation :
 +
 <code> <code>
 <tierce> hello how to search for <!-- TITLE: and replace with ====== using sed ? <tierce> hello how to search for <!-- TITLE: and replace with ====== using sed ?
Ligne 5: Ligne 11:
 <shbot> Riviera: ================== <shbot> Riviera: ==================
 <tierce> thank you ! <tierce> thank you !
-<tierce> is it possible to replace <!-- TITLE: some title --> by ====== some title ====== using sed ?+<tierce> is it possible to replace ====== some title ====== by ====== some title ====== using sed ?
 <Riviera> That would be <Riviera> That would be
 <Riviera> <!-- TITLE: ... until the end of the line? <Riviera> <!-- TITLE: ... until the end of the line?
Ligne 24: Ligne 30:
 <Riviera> well hm, since you are not looking for a robust solution anyway, <Riviera> well hm, since you are not looking for a robust solution anyway,
 <Riviera> perhaps this would suffice for your current situation: <Riviera> perhaps this would suffice for your current situation:
-<Riviera> # echo '<!-- something --><!-- TITLE: some title --><!-- something -->' | sed 's/<!-- TITLE: \([^>]*\) -->/====== \1 ======/g'+<Riviera> # echo '<!-- something -->====== some title ======<!-- something -->' | sed 's/<!-- TITLE: \([^>]*\) -->/====== \1 ======/g'
 <shbot> Riviera: <!-- something -->====== some title ======<!-- something --> <shbot> Riviera: <!-- something -->====== some title ======<!-- something -->
 <Riviera> sed 's/<!-- TITLE: \([^>]*\) -->/====== \1 ======/g' <Riviera> sed 's/<!-- TITLE: \([^>]*\) -->/====== \1 ======/g'