#!/bin/bash dirpath=$1 function read_dir() { for file in `ls $1` do #echo "$1:"$1 if [ -d $1/$file ];then cd $1/$file read_dir $1"/"$file cd - else echo `pwd`/$file fi done } read_dir $dirpath
#!/bin/bash dirpath=$1 function read_dir() { for file in `ls $1` do #echo "$1:"$1 if [ -d $1/$file ];then cd $1/$file read_dir $1"/"$file cd - else echo `pwd`/$file fi done } read_dir $dirpath