Replace 'test' invocation by 'test -n', this should be safer.