#!/bin/bash
ls -ltr | awk '{print $NF}' | while read a
do
if [ -f $a ]
then
echo $a >> /tmp/file
elif [ -d $a ]
then
echo $a >> /tmp/directory
else
echo "this is not a file"
fi
done
ls -ltr | awk '{print $NF}' | while read a
do
if [ -f $a ]
then
echo $a >> /tmp/file
elif [ -d $a ]
then
echo $a >> /tmp/directory
else
echo "this is not a file"
fi
done
No comments:
Post a Comment