expected/valid strings are:
home=/u/user1
home=/u/user2/
Not valid are:
home=/u/user3/blabla
home=/u/user4/bla/bla
home=/user5
home=/
How to ensure (test) that the string is right/expected one?
lets say the string is on $5. I did the following test:
[ `echo $5|grep ^home\=\/u\/.|wc -l` -eq 1 ]
But it doesn't aware for following - unexpected:
home=/u/user3/blabla
home=/u/user4/bla/bla
home=/u/user1
home=/u/user2/
Not valid are:
home=/u/user3/blabla
home=/u/user4/bla/bla
home=/user5
home=/
How to ensure (test) that the string is right/expected one?
lets say the string is on $5. I did the following test:
[ `echo $5|grep ^home\=\/u\/.|wc -l` -eq 1 ]
But it doesn't aware for following - unexpected:
home=/u/user3/blabla
home=/u/user4/bla/bla