开发者

perl + test perl syntax in my shell script (ksh)

开发者 https://www.devze.com 2023-01-13 15:34 出处:网络
I used the following syntax (part of ksh script) to verify if Validation word exist in LINE_FROM_FILE

I used the following syntax (part of ksh script) to verify if Validation word exist in LINE_FROM_FILE

    [[ "${LINE_FROM_FILE##*Validation}" != "${LINE_FROM_FILE}" ]] && print "match Validation"

the problem of this sytax that its also match word like Valid or ValidationVALID etc

and my target to开发者_StackOverflow中文版 match exactly the Validation word in the $LINE_FROM_FILE

I ask if its also possible to use perl syntax in my script to match exactly the Validation word

for example

   [[ ` some perl command ` = Validation  ]] && print "match Validation"

Lidia


yes. perl -e "insert; perl; code; here;"

e.g.: perl -e "print 'Validation'"

0

精彩评论

暂无评论...
验证码 换一张
取 消