1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #!/bin/sh # can use ls pipe to sed pipe to bash, similar to eval? see comment at link: # link also show perl-rename approach # https://linuxconfig.org/rename-all-files-from-uppercase-to-lowercase-charac#!/bin/sh # useful links # https://stackoverflow.com/questions/3430330/best-way-to-make-a-shell-script-daemon # https://serverfault.com/questions/117152/do-background-processes-get-a-sighup-when-logging-off # https://wiki.archlinux.org/tit find# I don't care about errors, I don't want to handle errors, just shut up please. # nohup seems not necessary if don't care about daemon SIGHUP requirement # when close a shell script's stdout or stderr with `>&-` or `2>&-`, `xsel -ib` in that script has no effect # https://github.com/kfish/xsel/issues/43 # using `>&-` or `2>&-` doesn't completely close mpv's output when run sth. like `o mpv file.mkv` # base on above observations, I choose to use `>/dev/null 2>&1` instead if [ $# -eq 1 ] && [ -e "$1" ] && { ! [ -x &q