[OT] bash redirection
Nick Dempelis
dempelis at ceid.upatras.gr
Wed Mar 24 10:58:09 EET 2004
Christos Ricudis wrote:
> On Tue, 23 Mar 2004 20:15:23 +0200
> Nick Dempelis <dempelis at ceid.upatras.gr> wrote:
>
>
>>exw ena bash shell script to opoio xontrika kanei:
>>echo 'mpe'
>>a.out
>>
>>opou a.out einai ena programma pou tipwnei sto stdout.
>>
>>sto linux ola douleuoun kanonika
>>alla se SunOS 5.7 (4x sparc CPUS)
>>to redirection den douleuei
>>px. shellscript > xxx.txt
>>to xxx.txt periexei mono to output tou echo (diladi mpe)
>>episis oute to | douleuei px. se commands tis morfis
>>shellscript | tee mpa.txt
>>epipleon oute sto nohup.out periexei auto pou 8elw (kai to mpe kai tin
>>e3odo tou a.out) otan trexw nohup shellscript
>
>
> Eisai APOLYTWS SIGOUROS oti to a.out sou trexei? :P
>
> Remember oti se polles periptwseis to $PATH DEN periexei thn teleia (dhladh to current working dir).
>
>
> $ cat > lala.c
> #include <stdio.h>
> main () {printf("...ki allo tou kanthlanafth!\n");}
> $ cc lala.c
> "lala.c", line 2: warning: old-style declaration or incorrect type for: main
> $ cat > lala.sh
> echo "Allo to pouli tou nayth..."
> a.out
> $ chmod gou+x lala.sh
> $ ./lala.sh > blabla
> ./lala.sh: a.out: not found
> $ cat blabla
> Allo to pouli tou nayth...
> $ PATH=$PATH:.
> $ export PATH
> $ ./lala.sh > tralala
> $ cat tralala
> Allo to pouli tou nayth...
> ...ki allo tou kanthlanafth!
> $
Euxaristw gia tin grigori apantisi. Eimai 99.9999% sigouros oti trexei
giati sto "kanoniko" scriptaki einai ./a.out kai otan to trexw xwris
redirection emfanizetai to output tou a.out ( ...ki allo tou
kanthlanafth :).Epipleon to a.out emfanizetai kai stin e3odo tis ps (se
oles tis periptwseis redirection or not). Otan ginetai to redirection
den pairnw tin e3odo tou a.out.
>
>
>>Exei sinantisei kanei paromoia simperifora? Yparxei lisi?
>>
>>euxaristw
>>
>>
>>
>
>
>
>
> ------------------------------------------------------------------------
>
>
Die evil redirection Dieeeeeee!!!!!!
More information about the Linux-greek-users
mailing list