help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] checking file line: 'commit;'


From: Greg Wooledge
Subject: Re: [Help-bash] checking file line: 'commit;'
Date: Thu, 11 Aug 2016 10:45:50 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Aug 11, 2016 at 04:34:28PM +0200, Paolo Supino wrote:
> Hi Chet
> 
> thank you for the reply, I tried [ "$string" = 'commit;' ] but it didn't
> work :-( and I don't think that case cuts it for my problem.

You probably have whitespace or other garbage in your string.
Find out what's in it, either by running that section of the script
with 'set -x' enabled, or by doing "declare -p string" before the
check, or by doing something like printf %s "$string" | hexdump.

If the string is coming from a file that has ever been touched by a
Windows machine, then carriage return is a very probable candidate for
your unwanted garbage character.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]