#!/bin/bash
#

numc=$(ls *.c 2>/dev/null| wc -l)

if  [ $numc -eq 0 ]
then echo "No files with extension .c"
else
    mkdir progc 2>/dev/null
    for i in *.c
    do
        echo "Moving $i"
        mv $i progc
    done
fi

numtxt=$(ls *.txt 2>/dev/null| wc -l)

if [ $numtxt -eq 0 ]
then echo "No files with extension .txt"
else
    mkdir txt 2>/dev/null
    for i in *.txt
    do
        echo "Moving $i"
        mv $i txt
    done
fi
