Okay so I'm on typing a script for android operating system (which is almost identical in linux when using bash scripts

) but I can't make the correct script to do what I want.
There is a directory
Code:
/sys/devices/virtual/bdi
Inside that directory there are folders that
all contain this file named
Code:
read_ahead_kb
So I tried changing the value of that file in all those folders by doing this but it doesn't take effect

And I need it to set the value or it won't boot into the phone (I set a infinite loop so that it continuously tries to change the values of that file in all the folders, but since it won't boot until it does change it and since it won't change it, it never boots). Any help with this would be awesome

Here is my attempt at the code:
Code:
#!/system/bin/sh
# SD CARD TWEAKS
SD=`ls -d /sys/devices/virtual/bdi/*`;
CHECK_SD=`cat /sys/devices/virtual/bdi/179:0/read_ahead_kb`;
until [ "$CHECK_SD" = "1024"]
do
for fix in $SD
do
echo 1024 $fix/read_ahead_kb;
done
done
Help is appreciated
