function to generate curl shellscript for downloading data from openneuro

gen_curl_sh(
  sh,
  include_and,
  include_or,
  exclude,
  subjects,
  filename = "curl_cmd.sh"
)

Arguments

sh

The filepath to sh file containing the curls commands as generated by openneuro

include_and

The curl commands have to contain all of the keywords specfied here will be included

include_or

The curl commands have to contain at least one of the keywords specfied here will be included

exclude

The curl commands which contain at least one of the keywords specfied here will be excluded

subjects

If specified only curl commands that include these subjects will be included

filename

filename of the .sh output file. Set to curl_cmd.sh by default.

Value

a vector of curl commands

Details

This function searches the sh input file for keywords matching strings specified in include_or, include_and, exclude and subjects, and returns a vector of curl commands as well as output a .sh file