escript: Edita rápidamente otros scripts que estén en el path
This commit is contained in:
parent
ee5ff0d970
commit
aa303fe66e
14
varios/escript
Executable file
14
varios/escript
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Script para editar rápidamente otros script sin necesidad de especificar su respectiva ubicación.
|
||||||
|
# Este script sólo buscará ejecutables que se encuentren en el PATH del sistema y el que el usuario
|
||||||
|
# haya definido
|
||||||
|
|
||||||
|
FILE_PATH=$(command -v "$1" 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -z "$FILE_PATH" ]; then
|
||||||
|
printf "%s\n" "Error: $1 no encontrado"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
$EDITOR "$FILE_PATH"
|
Loading…
Reference in a new issue