![]() |
![]() |
#23 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
5,261 Posts |
![]() Quote:
Code:
../../yafu/yafu "expr($c*$m)" -silent |
|
![]() |
![]() |
![]() |
#24 | |
Sep 2002
Database er0rr
5×29×31 Posts |
![]() Quote:
Code:
c4m=$(../../yafu/yafu $(expr $c4 \* $am) -silent) Code:
cm4=$(../../yafu/yafu "expr($c*$m)" -silent) Last fiddled with by paulunderwood on 2021-10-04 at 21:49 |
|
![]() |
![]() |
![]() |
#25 |
"Oliver"
Sep 2017
Porta Westfalica, DE
53916 Posts |
![]()
Wait, that's doing two fully different things!
There is expr of GNU coreutils (as in $(expr 2 \* 2)) and there is the YAFU function expr (as in expr(2*2) or ./yafu "expr(2*2)"). Edit: Executing something like ./yafu $(expr $var1 \* $var2) is like executing ./yafu 15, e.g. calling yafu only with a constant. GNU expr is already evaluating, so var1=$(var2 \* var3) or var1=$((var1*var2)) should be sufficient. I'm not sure up to which limit the latter one works. Last fiddled with by kruoli on 2021-10-04 at 21:56 Reason: Additions. |
![]() |
![]() |
![]() |
#26 |
Sep 2002
Database er0rr
5×29×31 Posts |
![]()
I'm not familiar with yafu. Shoud the quotes be escaped for yafu's expr in a bash expression?
Last fiddled with by paulunderwood on 2021-10-04 at 21:56 |
![]() |
![]() |
![]() |
#27 |
"Oliver"
Sep 2017
Porta Westfalica, DE
7·191 Posts |
![]()
Basically, the specific problem was that the command line was ignored by YAFU in the script because of redirecting a file. The syntax was okay in all cases.
Last fiddled with by kruoli on 2021-10-04 at 21:56 Reason: Clarifications. |
![]() |
![]() |
![]() |
#28 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
5,261 Posts |
![]() Quote:
Code:
./yafu "expr(number*number)" <options> |
|
![]() |
![]() |
![]() |
#29 | |
Sep 2002
Database er0rr
5·29·31 Posts |
![]() Quote:
Code:
cm4=$(../../yafu/yafu \"expr($c*$m)\" -silent) |
|
![]() |
![]() |
![]() |
#30 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
10100100011012 Posts |
![]() Quote:
Code:
YAFU says 31363920*3 is ytestW-N.sh: command substitution: line 15: syntax error near unexpected token `(' ytestW-N.sh: command substitution: line 15: `../../yafu/yafu \"expr($c*$m)\" -silent)' Code:
YAFU says 31363920*3 is ytestW-N.sh: command substitution: line 15: syntax error near unexpected token `(' ytestW-N.sh: command substitution: line 15: `../../yafu/yafu \"expr($c*$m)\" -silent)' no variable indicator (@): interpreting batchfile lines as input expressions eof; done processing batchfile Edit 2: These are the lines as edited into the above script: Code:
cm4=$(../../yafu/yafu \"expr($c*$m)\" -silent) echo $cm4 Last fiddled with by EdH on 2021-10-04 at 22:21 Reason: Removed irrelevant portion of first code block. |
|
![]() |
![]() |
![]() |
#31 |
Sep 2002
Database er0rr
118F16 Posts |
![]()
One last thing to try:
Code:
cm4=$(../../yafu/yafu \"expr($c\*$m)\" -silent) ![]() |
![]() |
![]() |
![]() |
#32 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
148D16 Posts |
![]() Quote:
Code:
YAFU says 31363920*3 is ytestW-N.sh: command substitution: line 15: syntax error near unexpected token `(' ytestW-N.sh: command substitution: line 15: `../../yafu/yafu \"expr($c\*$m)\" -silent)' |
|
![]() |
![]() |
![]() |
#33 |
Sep 2002
Database er0rr
5×29×31 Posts |
![]() Code:
#!/bin/bash a="31363920 948583258055568 -21094061301960794201597 -101781123694367174730692456309 1859252514529139843616145918243322920 1347307311985305327578340438707291179185984 951738172269489471300643 -167704995415343890580296180142353038" echo "$a" > testcase #exec < "testcase" read b < testcase c="31363920" d="${a:0:8}" e="${b:0:8}" m="3" echo "m is $m and d is $d and c is $c and b is ${b:0:10}... and a is ${a:0:10}..." printf "\nYAFU says $c*$m is " ../yafu/yafu "expr($c*$m)" -silent printf "\nYAFU says $d*$m is " ../yafu/yafu "expr($d*$m)" -silent printf "\nYAFU says $e*$m is " ../yafu/yafu "expr($e*$m)" -silent Code:
m is 3 and d is 31363920 and c is 31363920 and b is 31363920 9... and a is 31363920 9... YAFU says 31363920*3 is 94091760 YAFU says 31363920*3 is 94091760 YAFU says 31363920*3 is 94091760 (I compiled msieve for YAFU without zlib.) |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Startup Script | Gerard | Information & Answers | 2 | 2018-11-01 08:40 |
Simple Script to get Trial Factoring Work | jfamestad | PrimeNet | 3 | 2016-11-06 20:32 |
bash script for extracting primenet-status | gLauss | Linux | 0 | 2010-07-31 11:19 |
Could you help me change this into a bash script? | jasong | Programming | 1 | 2007-11-29 05:59 |
Help with Startup Script | Proggie | Software | 1 | 2004-12-19 11:54 |