Compare commits

..

2 commits

Author SHA1 Message Date
6d7ab08576 Засунул весь линк нейм в эчо 2023-07-14 20:56:51 +03:00
Hisumi
ce5b3688d5 test fix 2023-07-14 20:50:59 +03:00

View file

@ -1,21 +1,20 @@
# pootential arguments: # create symbolic links
# directory=$1 # by vim-like modelines
# options=$2 # of all files in the directory
# options for linking with "ln" # arguments
options="-sfvnr" directory=$1
# regular expression of link-modeline # link modeline regular expression
regex="^.{2,3}link: \K\S+" regex="^.{2,3}link: \K\S+"
files=($(grep -rPHl "${regex}")) files=(`grep -rPHl "${regex}"`)
destinations=($(grep -rPho "${regex}")) destinations=(`grep -rPho "${regex}"`)
# linking for ((e = 0; e <= (${#files[@]} - 1); e++));
for e in ${!files[@]};
do do
target=(${files[$e]}) target=${files[$e]}
link_name=(${destinations[$e]}) link_name=${destinations[$e]}
ln $options $target $link_name ln -sfvnr $target $(echo $link_name)
done done