Skip to main content
added 45 characters in body
Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242

If the following doesn't work...

cd ./target_dir
    set -- *
    onedrive-cli put "$@"

Then it's probably because you need a put for every argument in which case this might:

{    printf 'one-drive-cli' 
     printf " put '%s'"///%s///" *
} | sed 's|'\''|&"&"&|g;s|///|'\''|g' |
. /dev/stdin 

But if that doesn't work then your for loop probably is the best shell solution because your python script will only support one upload per invocation.

The best way to do it though is to edit the python script to meet your needs.

If the following doesn't work...

cd ./target_dir
    set -- *
    onedrive-cli put "$@"

Then it's probably because you need a put for every argument in which case this might:

{    printf 'one-drive-cli' 
     printf " put '%s'" *
} | . /dev/stdin 

But if that doesn't work then your for loop probably is the best shell solution because your python script will only support one upload per invocation.

The best way to do it though is to edit the python script to meet your needs.

If the following doesn't work...

cd ./target_dir
    set -- *
    onedrive-cli put "$@"

Then it's probably because you need a put for every argument in which case this might:

{    printf 'one-drive-cli' 
     printf " put ///%s///" *
} | sed 's|'\''|&"&"&|g;s|///|'\''|g' |
. /dev/stdin 

But if that doesn't work then your for loop probably is the best shell solution because your python script will only support one upload per invocation.

The best way to do it though is to edit the python script to meet your needs.

Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242

If the following doesn't work...

cd ./target_dir
    set -- *
    onedrive-cli put "$@"

Then it's probably because you need a put for every argument in which case this might:

{    printf 'one-drive-cli' 
     printf " put '%s'" *
} | . /dev/stdin 

But if that doesn't work then your for loop probably is the best shell solution because your python script will only support one upload per invocation.

The best way to do it though is to edit the python script to meet your needs.