I have two string like this...
a=[2018:08:22-15:26:18:26182619]
b=[2018:08:22-15:26:18:26182619]
And I want to convert
a= 20180911183706376476
b= 2018082215261826182619
Can anyone please help me out?
I have two string like this...
a=[2018:08:22-15:26:18:26182619]
b=[2018:08:22-15:26:18:26182619]
And I want to convert
a= 20180911183706376476
b= 2018082215261826182619
Can anyone please help me out?
From the "test, [ -- condition evaluation utility" manpage (accessible using the command man [ or man test), the '-ne' option is used for comparing integers. Use the '=' operator for strings.
n1 -eq n2 True if the integers n1 and n2 are algebraically equal.
s1 = s2 True if the strings s1 and s2 are identical.
It's probably not a bad idea to quote the strings as well. Make sure to use double (or soft) quotes with variables.
if [ "$a" = "$b" ]
then
#do something
fi