linux - Load image files from a folder bash script Ubuntu -


i new ubuntu , learning bash script googling around. want know how load image files folder , save in array in bash script.

probably not doing smart search, if knows how already, can please help?

i planning path command line argument, $1 have path, far have read.

thus, have code

#!/bin/bash f in "$1"     echo "$f" done 

but output prints 1 file instead of 36 files. can please me here?

note : input giving of format

/path/*.png  

that glob (/path/*.png) has been expanded shell when script called.

you have filenames in $@ (the array of positional parameters script/function).

try

echo "$@" 

to see them or

for file in "$@";     echo "$file" done 

the default list in $@ can use for file; do in place of for file in "$@"; do if want.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -