![]() |
![]() |
#12 | |
If I May
"Chris Halsall"
Sep 2002
Barbados
24·32·7·11 Posts |
![]() Quote:
![]() But I have found that strace can be ***very*** helpful in figuring out what's going on in complex situations like this. Not easy to work with, but it /should/ give you everything you need to know about what's actually going on. |
|
![]() |
![]() |
![]() |
#13 |
Sep 2002
Database er0rr
5×29×31 Posts |
![]()
Attach the script for us to debug. Specify which arguments you might be using with the script.
![]() |
![]() |
![]() |
![]() |
#14 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
5,261 Posts |
![]() Quote:
Code:
#!/bin/bash a="31363920 948583258055568 -21094061301960794201597 -101781123694367174730692456309 1859252514529139843616145918243322920 1347307311985305327578340438707291179185984 951738172269489471300643 -167704995415343890580296180142353038" echo "$a" > testcase #exec < "testcase" #read b 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 ... and a is 31363920 9... YAFU says 31363920*3 is 94091760 YAFU says 31363920*3 is 94091760 YAFU says *3 is wrong number of arguments in *, expected 2 0 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 no variable indicator (@): interpreting batchfile lines as input expressions eof; done processing batchfile YAFU says 31363920*3 is no variable indicator (@): interpreting batchfile lines as input expressions eof; done processing batchfile YAFU says 31363920*3 is no variable indicator (@): interpreting batchfile lines as input expressions eof; done processing batchfile |
|
![]() |
![]() |
![]() |
#15 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
148D16 Posts |
![]() Quote:
Last fiddled with by EdH on 2021-10-04 at 18:01 Reason: I just hate leaving out words, even little ones! |
|
![]() |
![]() |
![]() |
#16 | |
"Oliver"
Sep 2017
Porta Westfalica, DE
101001110102 Posts |
![]() Quote:
It is not a problem of bash, it only passes the information of not being connected to stdin to the YAFU process. You could work around that by modifying driver.c according to my last post (e.g. commenting out the part where is_cmdlinerun gets set to 2 and instead inserting something like printf("WARNING: custom build, automatic stdin batch file detection disabled.\n"); to save you from running into the opposite problem in the future at some point. |
|
![]() |
![]() |
![]() |
#17 |
Sep 2002
Database er0rr
5×29×31 Posts |
![]() Code:
am=3 c4=2346021463111956 echo "c4 is $c4 and am is $am" c4m=$(echo "expr($c4*$am)") echo "c4 is $c4 and c4m is $c4m" c4m=$(factor $(expr $c4 \* $am)) echo "c4 is $c4 and c4m is $c4m" |
![]() |
![]() |
![]() |
#18 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
5,261 Posts |
![]() Quote:
Thanks! |
|
![]() |
![]() |
![]() |
#19 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
526110 Posts |
![]() Quote:
Code:
YAFU says 31363920*3 is unrecognized variable or function 'factor94091760' Code:
YAFU says 31363920*3 is unrecognized character in input: -1 |
|
![]() |
![]() |
![]() |
#20 | |
Sep 2002
Database er0rr
5×29×31 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#21 |
"Ed Hall"
Dec 2009
Adirondack Mtns
122158 Posts |
![]() |
![]() |
![]() |
![]() |
#22 |
Sep 2002
Database er0rr
5·29·31 Posts |
![]()
Here is what you should test:
Code:
am=3 c4=2346021463111956 echo "c4 is $c4 and am is $am" c4m=$(echo "expr($c4*$am)") echo "c4 is $c4 and c4m is $c4m" c4m=$(../../yafu/yafu $(expr $c4 \* $am) -silent) echo "c4 is $c4 and c4m is $c4m" Last fiddled with by paulunderwood on 2021-10-04 at 21:24 |
![]() |
![]() |
![]() |
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 |