I have the following directory structure that I need to create, and while doing so, I need to also create the zip files which are symlinks./a/2015-08-17/a.zip  /a/2015-08-17/a_b/a_b.zip/a/2015-08-17/a_b/a_b_c/a_b_c.zip/a/2015-08-17/a_b/a_b_c/a_b_c_1/a_b_c_1.zip /a/2015-08-17/a_b/a_b_c/a_b_c_2/a_b_c_2.zip/a/2015-08-17/a_b/a_b_c/a_b_c_3/a_b_c_3.zipThe archives 1stdepth.zip, 2nddepth.zip etc exist and are the same each time. I am given the directory structure like the one above and I need to create the following sym links according to the depth in the directory structure.ln -s 1stdepth.zip /a/2015-08-17/a.zip  ln -s 2nddepth.zip /a/2015-08-17/a_b/a_b.zipln -s 3rddepth.zip /a/2015-08-17/a_b/a_b_c/a_b_c.zipln -s 4thdepth.zip /a/2015-08-17/a_b/a_b_c/a_b_c_1/a_b_c_1.zip  ln -s 4thdepth.zip /a/2015-08-17/a_b/a_b_c/a_b_c_2/a_b_c_2.zipln -s 4thdepth.zip /a/2015-08-17/a_b/a_b_c/a_b_c_3/a_b_c_3.zipHow would I go about doing this in a script? Should I count the / in the path and realise according to that what depth i am at? Is there a smarter way of doing it?I am using Solaris.
Symlinks according to directory depth
shell;solaris;symlink;ksh