2009/8/22 Pau Climent i Pérez <pclimentpe...@gmail.com>: > Vinga valents: > > Imaginem que declarem una variable M: > > $ M="hola món" > > $ echo $M > > hello world > > Ara tenim M declarada, i volem eliminar-li les aparicions de "món" per > afegir-hi, posem per exemple "gent". > > Com faríeu això? > > Jo pensava fer servir sed: > > $ echo $M | sed s/món/gent/ > > però ara com assigne el resultat a la variable M? > > M'explique? > > Pau. > > > -- > To UNSUBSCRIBE, email to debian-user-catalan-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org > >
Has de fer servir accents oberts per assignar el resultat a $M, d'aquesta manera: $ M=`echo $M | sed s/món/gent/` -- To UNSUBSCRIBE, email to debian-user-catalan-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org