3

in my linux machine red-hat 5.1 - in ppp file - I have only the signature.pl string !!!

  • remark - third application write the signature.pl string in to ppp file

I set ppp file in $a param And compare $a with signature.pl

But as all see here this not equal - why ? or if I have empty space? How to solve this?

    # more /var/tmp/ppp
    signature.pl
    # a=`cat /var/tmp/ppp`
    # echo $a
    signature.pl
    # [[ $a = signature.pl ]] && echo equal

or

    # [[ $a == signature.pl ]] && echo equal

diff example that works ! - from ksh shell (LINUX RED-HAT 5.1)

[u@h w]# echo signature.sh > file
[u@h w]# cat file
signature.sh
[u@h w]# a=`cat file`  
[u@h w]# echo $a
signature.sh
[u@h w]# [[ $a = signature.sh ]] && echo eq

 its print "eq"
HopelessN00b
  • 54,273
Eytan
  • 621

1 Answers1

3

You need two equal signs:

[[ $a == signature.pl ]] && echo equal
Rob Wouters
  • 1,967