0
I have the following code:
for (( c=1; c<=10; c++ ))
do
cc stringalea.c -o st
aux = ./st $c
echo $aux
...
done
The stringalea. c program returns a pseudo-random word of length "c". How do I enter the aux variable, the output of the executable ". /st $c"?
Use the command substitution: https://answall.com/q/327578/112052
– hkotsubo
aux=$(echo ./st $c ) writes in aux ". / st 1"
– user180270
No, it’s just
aux=$(./st $c)
– hkotsubo
Another thing, you need to compile the stringalea program. c all the time? Isn’t it better to compile once only before the
for
?– hkotsubo
I’ll change thanks already
– user180270