add generic_func

This commit is contained in:
2020-09-09 17:08:10 +08:00
parent ef851a2a47
commit e091b6e87c
2 changed files with 13 additions and 2 deletions

10
generic_func.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
function view_file(){
sys_name=`uname -s`
if [[ ${sys_name} == 'Linux' ]]; then
xdg-open ${1}
elif [[ ${sys_name} == 'Darwin' ]]; then
open ${1}
fi
}