1 2 3 4 5 6 7
#!/bin/bash p="$(which "$1")" && istxt="$(file "$1" | cut -d' ' -f2)" && exec $EDITOR $p || echo "Error!"