Skip to main content
3 of 4
edited tags
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

bash question about if and then

I'm writing this in my script. It has other parts but I'm getting stuck on this part only.

if [[$# == $year $month $day ]] ; then cal $day $month $year fi 

When I run this it give me this msg:

[[3: command not found 

So what is the problem? is it a syntax or actual command?

Here's the rest of my script if that helps:

year=$(echo "$year" | bc) month=$(echo "$month" | bc) day=$(echo "$day" | bc) if [[$# == $year $month $day ]] ; then cal $day $month $year fi