[gdb/testsuite] Clean up gdb/contrib/expect-read1.sh

Clean up script gdb/contrib/expect-read1.sh by:
- fixing shellcheck warnings,
- using mktemp (which takes TMPDIR into account) instead of a hardcoded
  "/tmp/expect-read1.$$.so",
- adding comments, and
- adding emacs / vi settings for local tab size 2 (copied from ./ltmain.sh).

Tested on x86_64-linux.

Approved-by: Kevin Buettner <kevinb@redhat.com>
1 file changed