regex v podmienke
potrebujem do podmienky IF umiestnit regularny vyraz...
If you are familiar with Regular Expressions, you can use this conditions to perform a regex match.
if [[ "$email" =~ "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b" ]]; then
echo "\$email contains a valid e-mail address."
fi
http://www.linuxtutorialblog.com/post/tutorial-conditions-in-bash-scripting-if-statements
____________________
v mojom pripade
if [[ "$velkost" =~ "\b[0-9]\b" ]]; then
3: line 71: conditional binary operator expected
3: line 71: syntax error near unexpected token `=~'
3: line 71: ` if [[ "$velkost" =~ "\b[0-9]\b" ]]; then'
FreeBSD/Bash Shell
_____________________
mate dake napady?
Pre pridávanie komentárov sa musíte prihlásiť.
staci tam dat == namiesto =~