File: set-mysql

package info (click to toggle)
percona-toolkit 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 68,916 kB
  • sloc: perl: 241,287; sql: 22,868; sh: 19,746; javascript: 6,799; makefile: 353; awk: 38; python: 30; sed: 1
file content (23 lines) | stat: -rwxr-xr-x 545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

if [ ! -d "$HOME/mysql-bin" ]; then
   echo "$HOME/mysql-bin does not exist." >&2
   exit 1
fi

VER=$1
if [ "$VER" ]; then
   if [ "$VER" != "4.1" -a "$VER" != "5.0" -a "$VER" != "5.1" -a "$VER" != "5.5" -a "$VER" != "5.6" ]; then
      echo "VERSION must be 4.1, 5.0, 5.1, 5.5, or 5.6.  Or, do not specify a version to select all available versions." >&2
      exit 1
   fi
else
   VER='';
fi

select choice in $(ls -d $HOME/mysql-bin/mysql-$VER* | sort -r); do
   echo "export PERCONA_TOOLKIT_SANDBOX=$choice"
   break
done

exit