I am trying to use a bash script to disinfect a database, and I need to use the largest ID from the users table, so I have this line in my script
MAXID=$(mysql -u root -proot elis27 -e "select max(idnumber) from mdl_user;") echo $MAXID
And the output of this line in my script is equal
max(idnumber) 3
How can I parse mysql command output so that maxid is only 3?
bash mysql
Kristopher Wagner Aug 28 '14 at 1:07 2014-08-28 01:07
source share