accessing variables inside a function
#!/bin/bash
extractor()
{
FILES=`ls -l |awk '/^-/ {print $9}'`
SUBDIR=`ls -l |awk '/^d/ {print $9}'`
}
looper()
{
for FIL in $FILES
do
permissions.sh $FIL $3
done
for DIR in $SUBDIR
do
echo " the permissions being passed to other script are $2"
permissions.sh $DIR $2
search.sh $DIR $2
done
}
echo " Processing the directory $1"
cd "$1"
extractor
looper
--------------------------------------------------------------------------------------------------------------------
when i try to pass the $3 in the looper function it is not able to acces the variable $3 .
why cant that function access that variable?
|