Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 1
    Actually, he probably doesn't want a here string, either. cal takes its parameters as arguments, not stdin. Commented Oct 7, 2014 at 19:39
  • That's true, but with here string cal at least outputs something, although not what one could expect. Commented Oct 7, 2014 at 19:43
  • im trying to use cal commands to validate dates and i get the error Commented Oct 7, 2014 at 21:20
  • while [[ $# -ne [1-8] ]]; do cal <<< ( $year $month $day ) done echo $year $month $day is valid date "check" 71L, 1821C written hgolmohammadi1@matrix:~/Lab2> check 1989 06 17 ./check: line 69: syntax error near unexpected token (' ./check: line 69: cal <<< ( $year $month $day )' Commented Oct 7, 2014 at 21:21
  • k i checked everything and the only problem i get is when i run this check 1989 06 16 it gives me ./check: line 68: [: [1-8]: integer expression expected Commented Oct 7, 2014 at 22:02