#!/bin/sh path="/home/andrej/doc/zapiski/doc/unix.md" chosen=$(cat "$path" | dmenu -i -l 30) link=$(echo "$chosen" | awk '{i = index($0, ":"); print substr($0, i+2)}') echo "$link" | xclip -selection clipboard