vendredi 6 février 2015

Comparing Strings in Shell

I am executing the below script.



#!/bin/sh
# Script to manipulate date
#

d="`date +%a`";
d1="Fri"
if [$d = $d1]
then
echo "Hey Man! Today's $d"
fi


No matter how I modify it, it always gives me an error on the line "if [$d = $d1]" ... Fri command not found.


Please help.


Aucun commentaire:

Enregistrer un commentaire