I am working on a script that will be run from an android shell (e.g. adb shell
). I have a problem with writing temporary files, as this demonstrates:
$ cat <<-EOF > foo
> EOF
sh: can't create temporary file /data/local/shd1v7x1.tmp: Permission denied
I want to direct the shell's temporary directory to somewhere that is writable. I would usually do this:
$ export TMPDIR=/path/to/somwehere/writable
$ cat <<-EOF > foo
but it makes no difference.
Is it possible to specify the location the shell should use for temporary files?
(I know that running as root
is a work around but that isn't a solution)