How to use cat and sort commands combinations?

Hi,
I need to get five names as input and sort it. It has to be done in the command level only. It should not read from any files.

I tried with many combinations. I didnt get it.

I can able to get the input using

cat > sample
jik
njvi
abifj

...like this and i dont know how to sort it here.

Many Thanks.

once file <sample> is ready

use the command sort

Is that what you are looking for ?

How do you want to sort them...alphabetically or its inverse?

cat <<EOF | sort -k1,1
jik
njvi
abifj
yada_yada
blah_blah
EOF

Hi Shamrock,

Exactly i want this only..Many Thanks to you

Hi Madhan,

I have gonethrough your reply. But i want exactly the Shamrock codings which he is given.

cat <<EOF | sort -k1,1
jik
njvi
abifj
yada_yada
blah_blah
EOF