'Bash string if-statement first char
#!/bin/bash
f="ABC"
if [[${f:0:1} == "A"]]
then
echo "True"
fi
Output : line 3: [[A: command not found
What is wrong?How can I check if the first char of $f is "A"?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
