I have an application running on Unix. I want to write a shell script that will detect whether I am on test machine or not.
The test machine name includes the word test in it. (i.e. myapplicationtest-00-abc)
The production machine does not include it. (i.e. myapplication-00-abc)
So depending on the machine type, I want to assign the value test to a variable. Then I will use this variable in my following commands.
$machineName = uname -n;
if ($machineName includes 'test')
rsync -avz --delete /opt/mydir1/mydir2 root@myapplication$var-00-abc:/opt/mydir1/mydir2