". I have tried to write the ${VAR:0:3} with different syntax but without success.
Here's the code
Note: In a terminal by just typing this, it works ... but not in a script for some reason.
Code: Select all
#!/bin/bash
VAR=$(uname -r)
VER=${VAR:0:3}
echo "Detected kernel version "`uname -r`
if [ "$VER" == '2.6' ]; then
echo "Trying 2.6 exploits"
fi