Hello:)
I need someone to translate this little bash script to C because now it consumes way to much CPU and so that i (and other people searching this on google) can learn walking with C! This will be most effective to learn and im planing to do a lot with C but yet iam a programmer of script languages only and know very basic java….
*BASH SCRIPT TO TRANSLASTE TO C*
a1=$1
a2=`expr $a1 + 1`
a3=`expr $a1 + 2`
a4=`expr $a1 + 3`
a5=`expr $a1 + 4`
Limit=`expr $a1 + 99999999999`
while [ $a1 -le $Limit ]
do
echo $a1,$a2,$a3,$a4,$a5 | sed 's/9,/9abc/g' >> List$1
a1=`expr $a1 + 500`
a2=`expr $a2 + 500`
a3=`expr $a3 + 500`
a4=`expr $a4 + 500`
a5=`expr $a5 + 500`
done
..Thus if i knew the following things in C this would be all for now.
- handleing the variables
- euivalent for >> adding to file but perferably with a cache to
reduce disk io! - something euivalent to $1 – allowing the user to set a variable
when running the C programm. - REGEX in C
- euivalent to | pipe in C
- Or how to execute a bash command within a C programm since it
cant get much faster than grep,sed anyways…
Thanks a lot to everyone reading this
Something like this: