Skip to main content
added 20 characters in body
Source Link
cody
  • 11.2k
  • 3
  • 28
  • 39

It's important to understand that Papers/*.pdf is not a regular expression, it's a wildcard pattern that causes bash to perform filename expansion, or globbing.

$1 represents the first argument to your script, so your for loop is only ever iterating over that one argument.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.

$1 represents the first argument to your script, so your for loop is only ever iterating over that.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.

It's important to understand that Papers/*.pdf is not a regular expression, it's a wildcard pattern that causes bash to perform filename expansion, or globbing.

$1 represents the first argument to your script, so your for loop is only ever iterating over that one argument.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done
added 20 characters in body
Source Link
cody
  • 11.2k
  • 3
  • 28
  • 39

$1 meansrepresents the first argument to your script, so your for loop is only ever iterating over that.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.

$1 means the first argument, so your for loop is only ever iterating over that.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.

$1 represents the first argument to your script, so your for loop is only ever iterating over that.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.

Source Link
cody
  • 11.2k
  • 3
  • 28
  • 39

$1 means the first argument, so your for loop is only ever iterating over that.

Use $@ to represent all arguments:

for i in "$@"; do
    doi "$i"
done

Additionally, it is important to understand that Papers/*.pdf is not a regular expression, it's filename expansion with globbing.