瀏覽代碼

Add xpst_l() and xpst_la(), symlinking variants of xpst()

Alois Mahdal 8 月之前
父節點
當前提交
629c553f48
共有 1 個檔案被更改,包括 30 行新增0 行删除
  1. 30
    0
      dotfiles/config/bashum/main.bashrc

+ 30
- 0
dotfiles/config/bashum/main.bashrc 查看文件

@@ -654,6 +654,36 @@ xpst() {
654 654
         done
655 655
 }
656 656
 
657
+xpst_l() {
658
+    #
659
+    # Symlink paths from clipboard, with relative paths
660
+    #
661
+    { xop o; echo; } \
662
+      | while read -r path; do
663
+            echo "path='$path'" >&2
664
+            test -e "$path" || {
665
+                echo "does not exist: $path"
666
+                continue
667
+            }
668
+            ln -sr "$path" .
669
+        done
670
+}
671
+
672
+xpst_la() {
673
+    #
674
+    # Symlink paths from clipboard, with absolute paths
675
+    #
676
+    { xop o; echo; } \
677
+      | while read -r path; do
678
+            echo "path='$path'" >&2
679
+            test -e "$path" || {
680
+                echo "does not exist: $path"
681
+                continue
682
+            }
683
+            ln -s "$path" .
684
+        done
685
+}
686
+
657 687
 xvb() {
658 688
     #
659 689
     # Edit text in primary clipboard and run it using bash