Category Archives: Shell

iterate over files in directory

To do not forget: FILES=/path/to/* for f in $FILES do filename=${f##*/} echo $filename done More informations: http://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion

Posted in Shell | Leave a comment

shell variable to execute a command

To do not forget: => variable=$(my_commands) json_files=$(find . -name “*.json”) echo $json_file

Posted in Shell | Leave a comment

shell – La commande read

La commande read lit l’entrée standard et affecte à la variable passé en paramètre la valeur: ~ read variable_1 foobar ~ echo $variable_1 ~ foobar Si vous voulez que le premier mot soit stocké dans la variable_1 et que le … Continue reading

Posted in Shell, Terminal | Leave a comment