iCloud
Q: I was making a terminal program to produce a txt file with incrementing numbers every line. But do to time and size I had wished the program to stop when it produced a txt file larger than 1GB here is the code I was using.
#!/bin/bash
main()
{
cd ~/desktop
a=0
b=1
a=`expr $a + 1`
echo $a
echo $a >> count.txt
run
}
count()
{
b= du -skL count.txt > /dev/null ///// problem here
a=`expr $a + 1`
clear
echo "#"$a "-" $b"KB"
echo $a >> count.txt
}
run()
{
cd ~/desktop
while [ $b -lt 1048576 ]
do
count
done
}
main
MacBook, OS X Mountain Lion (10.8.4)
Posted on Aug 1, 2013 9:19 AM
by BobTheFisherman,Solvedanswer
Your question has nothing to do with Bootcamp. You should find a more appropriate forum to post in.
Posted on Aug 1, 2013 9:22 AM