From e2bde98bb18e1063ddb00ab5c402f0cda43546d4 Mon Sep 17 00:00:00 2001 From: obrebski Date: Tue, 1 Apr 2008 19:15:47 +0000 Subject: [PATCH] Napawiony ser - musialem przerobic z powrotem te ` ` na system w dwoch liniach. (Wyglada na to, ze program uruchomiony w tych ` ` nie ma lacznosci z konsola) git-svn-id: svn://atos.wmid.amu.edu.pl/utt@20 e293616e-ec6a-49c2-aa92-f4a8b91c5d16 --- app/src/ser/ser | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/app/src/ser/ser b/app/src/ser/ser index 86164aa..c50e1ff 100755 --- a/app/src/ser/ser +++ b/app/src/ser/ser @@ -96,6 +96,7 @@ END exit 0; } + die("$0: no pattern given.\n") unless $pattern; die("$0: flex template file not found") unless @@ -154,26 +155,32 @@ my $defaultaction = ($only_matching) ? '' : 'ECHO'; (undef, my $tmpfile_c) = File::Temp::tempfile(SUFFIX=>'.c'); (undef, my $tmpfile_x) = File::Temp::tempfile(); +# w tych `` nie dziala +#`m4 "--define=PATTERN=$flexpattern" "--define=DEFAULTACTION=$defaultaction" $flextemplate > $tmpfile_l`; -`m4 "--define=PATTERN=$flexpattern" "--define=DEFAULTACTION=$defaultaction" $flextemplate > $tmpfile_l`; +system "m4 \"--define=PATTERN=$flexpattern\" \"--define=DEFAULTACTION=$defaultaction\" $flextemplate > $tmpfile_l"; if($flex) { - if(open(FLEX, $tmpfile_l)) { - while() { - print @_; - } - close FLEX; - } - else { - print "Unable to open file $tmpfile_l\n"; - } - exit 0; + # w tych `` nie dziala + system "cat $tmpfile_l"; +# if(open(FLEX, $tmpfile_l)) { +# while() { +# print @_; +# } +# close FLEX; +# } +# else { +# print "Unable to open file $tmpfile_l\n"; +# } + exit(0); } `flex -o$tmpfile_c $tmpfile_l`; `cc -O3 -o $tmpfile_x $tmpfile_c -lfl`; -`$tmpfile_x`; +#`$tmpfile_x`; + +system "$tmpfile_x"; unlink $tmpfile_l; unlink $tmpfile_c;