Tuesday, June 02, 2015

Simple bash scripts (work in progress!)

Have been focussing on scripting bash programs and managed to write some scripts.

A simple script to replace softlinks with target files:



          $ for i in `find . -type l -print`; do

          mv -v $(readlink $i) $i

          done
You can, replace `` with $(). Also, include $i in quotes as well if you wish.
Source: www.shellcheck.net

0 Comments:

Post a Comment

<< Home