If I want all user input to start with " : " if not display error
or what I asking is how to do if statement that control a first letter of string that we want to start with. and not worry about the rest
Thank
If I want all user input to start with " : " if not display error
or what I asking is how to do if statement that control a first letter of string that we want to start with. and not worry about the rest
Thank
Maybe something like this?
$
$
$ perl -lne 'die if !/^ : /; print "You entered => \"$_\""'
: hello
You entered => " : hello"
: world
You entered => " : world"
: the quick brown fox jumps over the lazy dog
You entered => " : the quick brown fox jumps over the lazy dog"
inigo montoya
Died at -e line 1, <> line 4.
$
$
$
tyler_durden