Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-19 Thread Tzafrir Cohen
On Sat, Apr 17, 2010 at 12:02:40PM -0400, Daniel D Jones wrote: On Saturday 17 April 2010 00:09:28 Michael Elkins wrote: On Fri, Apr 16, 2010 at 08:15:38PM -0400, Daniel D Jones wrote: What I'm trying to do is pretty simple. Getting it to work is turning out not to be. What I want to do

Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-17 Thread Daniel D Jones
On Saturday 17 April 2010 00:09:28 Michael Elkins wrote: On Fri, Apr 16, 2010 at 08:15:38PM -0400, Daniel D Jones wrote: What I'm trying to do is pretty simple. Getting it to work is turning out not to be. What I want to do is call a bash script with a couple of arguments, and, within the

Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-17 Thread Michael Elkins
On Sat, Apr 17, 2010 at 12:02:40PM -0400, Daniel D Jones wrote: That was the first thing I tried and sed gave me an error: sed: -e expression #1, char 18: unknown option to `s' I just went back and tried it again and it worked, so I have no idea what I did the first time that made it not work.

Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-17 Thread Chris Davies
Daniel D Jones ddjo...@riddlemaster.org wrote: What I want to do is call a bash script with a couple of arguments, and, within the script, call sed to use those args to replace two placeholders in a file: bashscript SUB1 SUB2 This line inside bashscript doesn't work: sed -e

Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-17 Thread Teemu Likonen
* 2010-04-17 09:34 (-0700), Michael Elkins wrote: You can run into that sort of problem if your pattern to replace contains any forward slashes (/) in it. If you need to such an expansion, you probably want to do it in two passes, first doing a / to \/ substitution on your replacement

Bash script - pass command line arg to embedded sed script with multiple args

2010-04-16 Thread Daniel D Jones
What I'm trying to do is pretty simple. Getting it to work is turning out not to be. What I want to do is call a bash script with a couple of arguments, and, within the script, call sed to use those args to replace two placeholders in a file: bashscript SUB1 SUB2 This line inside bashscript

Re: Bash script - pass command line arg to embedded sed script with multiple args

2010-04-16 Thread Michael Elkins
On Fri, Apr 16, 2010 at 08:15:38PM -0400, Daniel D Jones wrote: What I'm trying to do is pretty simple. Getting it to work is turning out not to be. What I want to do is call a bash script with a couple of arguments, and, within the script, call sed to use those args to replace two

Re: bash or sed script

2005-06-08 Thread J.Pierre Pourrez
Le Tue, 07 Jun 2005 16:39:13 +0200, mess-mate a écrit : Ce dernier script marche à MERVEILLE. Tous les anciens fichiers sont enlevés et un nouveau du jour est crée; si un nouveau du jour existe déjà celui-ci est remplacé ! Reste encore: - si plusieurs répertoires à sauver. - que le script

Re: bash or sed script

2005-06-08 Thread mess-mate
J.Pierre Pourrez [EMAIL PROTECTED] wrote: | Le Tue, 07 Jun 2005 16:39:13 +0200, mess-mate a écrit : | | Ce dernier script marche à MERVEILLE. Tous les anciens fichiers sont | enlevés et un nouveau du jour est crée; si un nouveau du jour existe | déjà celui-ci est remplacé ! Reste encore: | -

Re: bash or sed script

2005-06-08 Thread Jacques L'helgoualc'h
mess-mate a écrit, mercredi 8 juin 2005, à 13:51 : [...] La crontab exécute à une certaine heure, non ? Donc pas utilisable pour mon cas. Avec anacron, alors ? En outre pour sauvegarder des rép. comm par ex. /etc il faut les permissions root. Comment faire ? Sous root, ou avec sudo. --

Re: bash or sed script

2005-06-08 Thread mess-mate
Jacques L'helgoualc'h [EMAIL PROTECTED] wrote: | mess-mate a écrit, mercredi 8 juin 2005, à 13:51 : | [...] | La crontab exécute à une certaine heure, non ? | Donc pas utilisable pour mon cas. | | Avec anacron, alors ? | | En outre pour sauvegarder des rép. comm par ex. /etc il faut les |

Re: bash or sed script

2005-06-08 Thread Frédéric LEGER
Bonjour, Je ne comprends pas bien le concept, pourquoi ne pas faire tourner cela sous root via une tche cron classique excut au reboot ? mess-mate a crit: Jacques L'helgoualc'h [EMAIL PROTECTED] wrote: | mess-mate a crit, mercredi 8 juin 2005, 13:51 : | [...] | La crontab excute une

Re: bash or sed script

2005-06-08 Thread Jacques L'helgoualc'h
Frédéric LEGER a écrit, mercredi 8 juin 2005, à 17:06 : Bonjour, bonjour, Je ne comprends pas bien le concept, pourquoi ne pas faire tourner cela sous root via une tâche cron classique exécuté au reboot ? C'est justement ce que fait anacron, rattraper le boulot en retard quand on rallume la

Re: bash or sed script

2005-06-08 Thread mess-mate
Frédéric LEGER [EMAIL PROTECTED] wrote: | Bonjour, | | Je ne comprends pas bien le concept, pourquoi ne pas faire tourner cela sous root via une | tâche cron classique exécuté au reboot ? | | mess-mate a écrit : | | Jacques L'helgoualc'h [EMAIL PROTECTED] wrote: | | mess-mate a écrit,

Re: bash or sed script

2005-06-08 Thread mess-mate
mess-mate [EMAIL PROTECTED] wrote: | Frédéric LEGER [EMAIL PROTECTED] wrote: | | Bonjour, | | | | Je ne comprends pas bien le concept, pourquoi ne pas faire tourner cela sous root via une | | tâche cron classique exécuté au reboot ? | | | | mess-mate a écrit : | | | | Jacques L'helgoualc'h

Re: bash or sed script

2005-06-07 Thread Jacques L'helgoualc'h
mess-mate a écrit, mardi 7 juin 2005, à 00:42 : Bonsoir, bonjour, comme j'ai pas d'expérience avec l'extraction d'une partie de mot d'un mot, voici mon pb: J'ai un fichier Boot-07.tgz de ce fichier je voudrais y retrouver le '07' qui représente le n° du jour $ FILE=Boot-07.tgz $

Re: bash or sed script

2005-06-07 Thread mess-mate
Jacques L'helgoualc'h [EMAIL PROTECTED] wrote: | mess-mate a écrit, mardi 7 juin 2005, à 00:42 : | Bonsoir, | | bonjour, | | comme j'ai pas d'expérience avec l'extraction d'une partie de mot | d'un mot, voici mon pb: | J'ai un fichier Boot-07.tgz | de ce fichier je voudrais y retrouver le

Re: bash or sed script

2005-06-07 Thread Jacques L'helgoualc'h
mess-mate a écrit, mardi 7 juin 2005, à 16:39 : Jacques L'helgoualc'h [EMAIL PROTECTED] wrote: [...] | Le script suivant devrait faire à peu près ce que tu demandes ? | | ARCHIVE_DU_JOUR=Boot-$(date '+%Y-%m-%d').tgz | | tar czf $ARCHIVE_DU_JOUR /les/reps/à/sauver { \ | ls -1

bash or sed script

2005-06-06 Thread mess-mate
Bonsoir, comme j'ai pas d'expérience avec l'extraction d'une partie de mot d'un mot, voici mon pb: J'ai un fichier Boot-07.tgz de ce fichier je voudrais y retrouver le '07' qui représente le n° du jour et si il est plus petit que celui que je vais créer au jour '08', qu'il soit effacé. Il est

Re: Problem mit Variable in sed-Script

2005-03-01 Thread Michelle Konzack
Am 2005-03-01 01:49:18, schrieb Andreas Schmidt: Hallo, ich will per Script eine Zeile aendern lassen. Der Suchstring ist in einer Variablen gespeichert: SEARCH=^AllowUsers.*$ cat $CONFFILE | sed -e 's/$SEARCH/AllowUsers $NAMES/' ^

Re: Problem mit Variable in sed-Script

2005-03-01 Thread Andreas Schmidt
On 2005.03.01 09:42, Michelle Konzack wrote: Warum nicht: SEARCH=^AllowUsers.*$ sed -e s/$SEARCH/AllowUsers $NAMES/ $CONFFILE ist einfacherer und sauberer. Bin halt ein kleiner Schmierfink. :-) Ansonsten spricht aber wohl wirklich nichts dagegen, das zu aendern. Schoenen Gruss,

Problem mit Variable in sed-Script

2005-02-28 Thread Andreas Schmidt
Hallo, ich will per Script eine Zeile aendern lassen. Der Suchstring ist in einer Variablen gespeichert: SEARCH=^AllowUsers.*$ cat $CONFFILE | sed -e 's/$SEARCH/AllowUsers $NAMES/' Habe aber gerade feststellen muessen, dass das nicht funktioniert -- kein Wunder, sed

Re: Problem mit Variable in sed-Script

2005-02-28 Thread erkan yanar
On Tue, Mar 01, 2005 at 01:49:18AM +0100, Andreas Schmidt wrote: Hallo, ich will per Script eine Zeile aendern lassen. Der Suchstring ist in einer Variablen gespeichert: SEARCH=^AllowUsers.*$ cat $CONFFILE | sed -e 's/$SEARCH/AllowUsers $NAMES/' cat $CONFFILE | sed

Re: Problem mit Variable in sed-Script

2005-02-28 Thread Andreas Schmidt
Guten Morgen! On 2005.03.01 04:45, erkan yanar wrote: On Tue, Mar 01, 2005 at 01:49:18AM +0100, Andreas Schmidt wrote: Hallo, ich will per Script eine Zeile aendern lassen. Der Suchstring ist in einer Variablen gespeichert: SEARCH=^AllowUsers.*$ cat $CONFFILE | sed -e

Sed script

1999-10-22 Thread zdrysdal
Hi Not debian related but i need help nonetheless. i need to extract the number 997841138254, or any other number from that position, from an hl7 file. The file will look like this : MSH...OBR|0001||997841138254|..F I can use OBR as the starting point of the search and then use

Re: Sed script

1999-10-22 Thread Eric G . Miller
On Fri, Oct 22, 1999 at 04:28:29PM +1300, [EMAIL PROTECTED] wrote: Hi Not debian related but i need help nonetheless. i need to extract the number 997841138254, or any other number from that position, from an hl7 file. The file will look like this :

Re: Sed script

1999-10-22 Thread Eric G . Miller
Duh, even easier: $ cut --delimiter='|' --fields=N infile outfile where N = the fields you want. See man cut. -- ++ | Eric G. Milleregm2@jps.net | | GnuPG public key: http://www.jps.net/egm2/gpg.asc |

Re: Sed script

1999-10-22 Thread Joakim Svensson
Hi all, i need to extract the number 997841138254, or any other number from that position, from an hl7 file. The file will look like this : MSH...OBR|0001||997841138254|..F I can use OBR as the starting point of the search and then use the | to move to the begginning of the