PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > how is it done(sed)
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

how is it done(sed)

Réponse
 
LinkBack Outils de la discussion
Vieux 23/08/2006, 05h27   #1 (permalink)
JyotiC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how is it done(sed)

hi
i want
configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`
to be appended to the file configure but $1 sld be replaced by the
command line argument supplied to shell script

hv tried out commands but $1 is not being replaced
the one i tried is
sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`'
configure

what should be done to write the value of $1
thanx
Jyoti

  Réponse avec citation
Vieux 23/08/2006, 06h17   #2 (permalink)
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how is it done(sed)

On 22 Aug 2006 21:27:00 -0700, JyotiC
<jyoti.chhabra@gmail.com> wrote:
> hi
> i want
> configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`
> to be appended to the file configure but $1 sld be replaced by the
> command line argument supplied to shell script
>
> hv tried out commands but $1 is not being replaced
> the one i tried is
> sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`'
> configure
>
> what should be done to write the value of $1
> thanx
> Jyoti
>

sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ '$1' / /"`'


--
<Mercury> Knghtbrd: Hey, perl has the power grace and elegance of a sledge
hammer. (=:]
<|Rain|> certainly the grace and elegance, anyway
  Réponse avec citation
Vieux 23/08/2006, 06h32   #3 (permalink)
JyotiC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how is it done(sed)

thanx for your
Bill Marcum wrote:
> On 22 Aug 2006 21:27:00 -0700, JyotiC
> <jyoti.chhabra@gmail.com> wrote:
> > hi
> > i want
> > configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`
> > to be appended to the file configure but $1 sld be replaced by the
> > command line argument supplied to shell script
> >
> > hv tried out commands but $1 is not being replaced
> > the one i tried is
> > sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`'
> > configure
> >
> > what should be done to write the value of $1
> > thanx
> > Jyoti
> >

> sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ '$1' / /"`'
>
>
> --
> <Mercury> Knghtbrd: Hey, perl has the power grace and elegance of a sledge
> hammer. (=:]
> <|Rain|> certainly the grace and elegance, anyway


  Réponse avec citation
Vieux 23/08/2006, 09h51   #4 (permalink)
Stephane Chazelas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how is it done(sed)

On 22 Aug 2006 21:27:00 -0700, JyotiC wrote:
[...]
> configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`
> to be appended to the file configure but $1 sld be replaced by the
> command line argument supplied to shell script
>
> hv tried out commands but $1 is not being replaced
> the one i tried is
> sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`'
> configure

[...]

printf '%s\n' >> configure \
"configdirs=\`printf '%s\n' " \$configdirs " | sed 's/ $1 / /'\`"


--
Stephane
  Réponse avec citation
Vieux 23/08/2006, 10h01   #5 (permalink)
JyotiC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how is it done(sed)

thanx for ur
Stephane Chazelas wrote:
> On 22 Aug 2006 21:27:00 -0700, JyotiC wrote:
> [...]
> > configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`
> > to be appended to the file configure but $1 sld be replaced by the
> > command line argument supplied to shell script
> >
> > hv tried out commands but $1 is not being replaced
> > the one i tried is
> > sed -i -e '$a\configdirs=`echo " ${configdirs} " | sed -e "s/ $1 / /"`'
> > configure

> [...]
>
> printf '%s\n' >> configure \
> "configdirs=\`printf '%s\n' " \$configdirs " | sed 's/ $1 / /'\`"
>
>
> --
> Stephane


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h20.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09415 seconds with 13 queries