Last active
December 2, 2015 17:02
-
-
Save oxcar103/c777432428f511362d4b to your computer and use it in GitHub Desktop.
Script to open a list of files. It's very useful to open a list of PDF's to study for a subject's exam 😆
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Para corregir errores con los directorios que contengan espacios: | |
SAVEIFS=$IFS; | |
IFS=$(echo -en "\n\b"); | |
# A partir del directorio actual, abrimos con la aplicación por defecto | |
# (xdg-open), la lista de archivos mostrados por el comando "ls". | |
# A este script se le pueden pasar los mismos parámetros que a "ls"(pues | |
# básicamente, se le pasan directamente a dicho comando). | |
for i in $(ls $@) | |
do | |
(xdg-open $i &); | |
done | |
# Restauramos el valor modificado | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment