Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

what_happened

#!/bin/sh

# this is a comment

# let's give some values to variables
SOMETHINGELSE=TTT
DOGS=10
CATS=YELLOW

# if you uncomment the next line the "if" test will will be false
#CATS=ELLO

DOGS=1

echo "Let's do a loop"
for i in 1 2 3 4 5 100 200 112938 019283093 $SOMETHINGELSE $DOGS $CATS
do
  echo "Looping ... number $i"
done


if [ "$CATS" = "YELLOW" ]; then
  whatwesay="By the way, cats are yellow."
else
   whatwesay="what just happend?"
fi

# what do we say?
echo $whatwesay

# echo the "cal" command, defaults to current month
echo
cal

# -3 just prints out three months
echo `cal -3`

# make a blank line
echo

# let's loop through cal!
for x in `cal -3`
do
echo $x
done

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.