Re: Directory level Depth check - Shell script



On 2008-01-29, Meendar wrote:

Anybody know how to compare the directory depth level of two
directories, whether their depth level are same or not through shell
script. (also depth level for each sub-directory )

path=/absolute/path/to/directory
IFS=/
set -f
set -- $path
depth=$#

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.



Relevant Pages

  • Re: Directory level Depth check - Shell script
    ... whether their depth level are same or not through shell ... script. ... (also depth level for each sub-directory) ...
    (comp.unix.programmer)
  • Directory level Depth check - Shell script
    ... Anybody know how to compare the directory depth level of two ... whether their depth level are same or not through shell ... script. ...
    (comp.unix.programmer)
  • Re: Directory level Depth check - Shell script
    ... Anybody know how to compare the directory depth level of two ... whether their depth level are same or not through shell ... Count the number of '/' characters in the pathnames and compare them. ...
    (comp.unix.programmer)
  • Re: Directory level Depth check - Shell script
    ... whether their depth level are same or not through shell ... script. ... (also depth level for each sub-directory) ... i have googled abt this, but couldn't find the prompt answer. ...
    (comp.unix.programmer)
  • Re: Directory level Depth check - Shell script
    ... Meendar wrote: ... Anybody know how to compare the directory depth level of two ... Count the number of '/' characters in the pathnames and compare them. ...
    (comp.unix.programmer)