From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26782 invoked by alias); 6 Mar 2016 13:33:21 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21361 Received: (qmail 607 invoked from network); 6 Mar 2016 13:33:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 Date: Sun, 6 Mar 2016 14:20:13 +0100 From: Meino.Cramer@gmx.de To: zsh-users@zsh.org Subject: Converting absolut symlinks to relative ones...? Message-ID: <20160306132013.GA4938@solfire> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: mutt-ng/devel-r804 (Linux) X-Provags-ID: V03:K0:mLGwioYbEIKX/BbTL9I2Na7QvsBcYnH5+eTA+kg42i9FQofESXY PoT+cdSOvn1/wR3McBrtbBlGElU1Gha84rMsXMNhKWmckWHpMD84nAsG0RABmjbg8M0JlqQ oY+MA/mef4U2EV1qw/SDJRckF4kKvikC8kqOzlht1kSdSA1U/nFnVAI+8qmRykyBL1jPCV5 BL/87kMNWYsytxLsMelrw== X-UI-Out-Filterresults: notjunk:1;V01:K0:3lVGIsZpKZM=:VRh80PYSrQSRZUdMl6IviM aSLB1Q4renABFecby6hxcRzH9jvdYISfiIrwCHdY0TQz8Cv9gxdLDRUaH8vsXp0AU/FATAOkK HvxZhg9/cNMYG2Au6f80cQIRXt779dxyvzoiYZSAMHK3PCvZHUdxZoYlP4oHzUAYiYkui4fub C5Tc25U6DVUsRYOsSa2QonmGCvIYdkQCG7m61wkG/JU/NInCGgPq9S334Ao3jezVUMQcevOyQ 4m1dNP2SMkP5Wq80QWjXg1PWcdvaN7e6ntfPqFdUvnXd9m1SVpjn7lytCZseHuTuK3tO+PC3r hDHNm69eCOuarLLvA0a7XBi5Uemu5M0bdYRDkQKu8EXPzH6R7bMuD1uqTkmM9d6OX+3MX9GvE TpysZo7aXPhcWNCZkEC+JhnNb2Rq6sv9Y5+dyLzM3KHb7G9h1KC7E6VIOS4tRS62i+W1YoNaZ 4dr73u9j6wFi2RosVoY/xBX9em9E9SV8h/nbhM6Y+rQBjO4TMxUwMKLmQZj/hXQDw+jTS4ggJ Jfani3zHf3gKeeW2Vmt0uLO0vnDH11UK4YEvf/w+fsTeQGUIFUyz0B3CWYHYEm92/ayv0j6wm rv9EAOHUCgJcxOnelUaT4W+GFNLCMtpduZZKY57SAdSnHc38hkrQMgjU7FVvPwLn/aArmE2sj xkggqfPVVWkt1iNt4rr2wMuEjuMJxAs9W3tT+qf3XNZ95cFgyvLaCH4J94HUObiYltYa5aKHl 6beZyaADsS8wct9XicjFClkOq/oI0Rk4cMGTzW5pbQ44bxhqz6aArVEkAaE= Hi, following "problem": At some point in a directory tree there is a file (the reference), which is physically copied multiple times into that tree below that point at different nesting depths. I want to create a script which will find those files (already done) and replace those files with a symlink to the reference file. Since I dont know of a simple way to calculate the "difference" of two absolute paths to create a relative path to the reference from the point of view of its current copy, I came across the idea to create symlinks with absolute paths to the reference in a first step and hope that there is a zsh/system/linux utility which will create relative symlinks afterwards... This idea has one drawback: I dont know of such an utility... ;) Is there such an utility or is there even an utility which magically do that all in one turn? Thank you very much in advance for any help! Best regards, Meino