On Fri, Jan 11, 2002 at 03:28:04PM +0100, Lentila de Vultur wrote:
> 
> > 
> > On Fri, Jan 11, 2002 at 03:02:54PM +0100, Lentila de Vultur wrote:
> > > 
> > > 
> > > cum pot sa scriu intr-un fishier folosind awk? (gnu awk 3.1.0)
> > > am incercat:
> > > 
> > > user@statzie:~/bin> awk '{print "22" > file }'
> > > 
> > > awk: cmd. line:1: (FILENAME=- FNR=1) fatal: expression for `>'
> > redirection
> > > has null string value
> > > user@statzie:~/bin>
> > > dupa ce am lansat comanda am mai dat un "enter" -> linia goala care
> > apare
> > > inainte de mesajul de eroare.
> > 
> >     awk  '{print "22"; }'
> > nu merge. poti incerca
> >     echo | awk  '{print "22"; }'
> >     
> > 
> > > 
> > > am un script bash cu linii awk shi vreau ca o variabila setata de awk sa
> > o
> > > folosesc in scriptul bash. se poate shi altcumva fatza de cum am incert
> > io?
> > 
> > 2. nu stiu cum face awk redirect to file, dar de ce nu foloseti bash
> > pentru asta?
> > a=$(echo | awk  '{print "22";}') ; echo $a
> 
> 10x, dar nu pot folosi asta.
> am ceva de genul
> 
> #!/bin/bash
> 
> [comenzi]
> 
> echo $string | awk -F. '{ [prelucrez string, afishez daca is erori, scriu
> ceva intr-un fishier] }'
> 
> [citesc din fishier, prelucrez cu bash]
> 
> 
> man awk:
> print expr-list >file Prints expressions  on  file.   Each
>                              expression is separated by the value
>                              of the  OFS  variable.   The  output
>                              record  is terminated with the value
>                              of the ORS variable.

rahat, trebuie
        print "blabla" > "file_name"
                         ^         ^ in ghilimele


-- 
        ___
       <o-o>    Viorel ANGHEL <vang @ lug.ro>
       [`-']    
       -"-"-    In Linux We Trust.
---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to 
unsubscribe from this list.

Raspunde prin e-mail lui