[OT] bash redirection
Christos Ricudis
ricudis at itc.auth.gr
Wed Mar 24 10:08:36 EET 2004
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!
$
>
> Exei sinantisei kanei paromoia simperifora? Yparxei lisi?
>
> euxaristw
>
>
>
--
Christos Ricudis ricudis at itc.auth.gr
Systems Administrator +30-2310-998305
IT Support Center
Aristotles University of Thessaloniki, GREECE
More information about the Linux-greek-users
mailing list