T
T
Trianid Trianid2018-03-05 21:48:14
linux
Trianid Trianid, 2018-03-05 21:48:14

Why do two conditions work at once in Cron?

Hello.
OS UBUNTU 16.04
There is a script:

#!/bin/sh
old_info="156387"
new_info="156390"
echo ${old_info}
echo ${new_info}
if [ "$old_info" != "$new_info" ]; then
sh /bash1/do.sh
else echo "Do nothing"
fi

In the crone it looks like this:
*/1 * * * * sh /bash1/dyn/ip.sh
When manually launched from the terminal - everything works fine - if the data differs - the second script is launched. In the crown, regardless of the input data, the launch of the second script is triggered.
What am I doing wrong? =) Thanks and help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-03-05
@trianid

Show exactly how you supply the input data.
There is a suspicion that you do not know the meaning of the export command, and in fact you have two empty variables in comparison (which are equal)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question