#!/bin/sh
# change this to the dir you want cache to be stored
cachedir=/mnt/card/.cache
# change the 'dir' variable to '0', run the commands up to 'done',
# then change the 'dir' variable to 'a' and run the commands again,
# repeat until ';' is encountered.
for dir in 0 a b c d e f g h i j k l m n o p q r s t u v w x y z; do
# -p = make all parent dirs (if they don't already exist).
# $something means variable 'something'
# so for first run the command would become:
# mkdir -p /mnt/card/.cache/0
mkdir -p $cachedir/$dir
# -s = make symbolic link
# make a link to $cachedir/$dir from / called $dir
ln -s $cachedir/$dir /$dir
done
# run konqueror
/opt/QtPalmtop/bin/konqueror
# remove all those links (now that konqueror has closed)
# change the 'link' variable to '0', then run 'rm /0',
# then change 'link' to 'a', run 'rm /a', and so on...
for link in 0 a b c d e f g h i j k l m n o p q r s t u v w x y z; do
rm /$link
done
How's that?
this has not been tested btw. a few notes:
1. If konqueror forks into the background this script will be useless (untested).
2. This script does not delete the cache- it just gets rid of those links. I think this is probably a good idea, but if you want more space on your sd check the .cache dir.
3. To modify the script to delete the cache as well, add the line 'rm -rf $cachedir' to the end.
that will all fit on one line btw (using ;'s which could be classed as cheating), though it could probably be made more efficient.