On 8/21/20 1:58 AM, jdd@dodin.org wrote:
#!/bin/sh for i ; do j=$(readlink $i) ; k=sed -i 's///run/media/jdd/intenso5to2/../..//g' $j ; ln -sf $k $i ; done
Are you linking directories only are all files? If you give a 'tree' (just a representative directory/file example), I"m happy to help you write a short script to automate rebuilding your links (I do something similar with photos in Gallery2) How you feed your loop will depend on how deeply nested your file storage is. You "day long" computing can be reduced to just a few minutes by avoiding spawning additional subshells within the body of your loop. The command-substitution with sed will require 2 subshells per-iteration. That is where your time comes from. With bash, parameter expansions will avoid the additional subshells. You can also do it all within a single call to awk which would be orders of magnitude faster. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org