#!/bin/sh
checking()
{
cd "$1"
for D in *;do
if [ -d "$D" ]; then
cd "$D"
for d in *;do
echo "$d"
if [ -d "$d" ]
then
`checking() $d`
fi
if [ -f "$d" ]
then
file_name=`echo "$d" | cut -d'.' -f1`
echo $file_name
file_ext=$(echo $d |awk -F . '{if (NF>1) {print $NF}}')
echo $file_ext
if [ $file_ext = bin ]
then
strings $d > $file_name.txt
mv $file_name.txt /somepath
fi
fi
done
cd ..
fi
done
}
a=$(pwd)
checking() $a
I am converting session log binary files into text files and storing on some path using strings function. For every directory it is performing fine,but it is not checking the binary files for any sub directory present.
I tried using recursive function call but that call is not being fired..Please help
hellowith something likehello arg1 arg2. Bash actually gives you an error message forsomething() $a,dashcrashed when I tried that...