I'm trying to write a fish function to display a notification after long commands have completed running. I have it working, but I'd like to know if there is a nicer way to get interpolation working with nested quotes.
function record_runtime --on-event fish_postexec
set text \"$argv took $CMD_DURATION\"
set command "display notification $text"
if [ $CMD_DURATION -gt 60000 ]
osascript -e "$command"
end
end
I was hoping for a one liner like osascript -e 'display notification "$argv took $CMD_DURATION"' but could not find a combination that worked.