facebookresearch / UnsupervisedMT

Phrase-Based & Neural Unsupervised Machine Translation
Other
1.51k stars 262 forks source link

Mac can't go through line 149 in "get_data_*.sh". #72

Closed yongchanghao closed 4 years ago

yongchanghao commented 5 years ago

Bash on macOS can't process with "-3", but is ok to with"21".

derlin commented 5 years ago

Here is how I solved it on Mac:

# OUTPUT="${FILENAME::-3}" --> ERROR on MacOS:  substring expression < 0
OUTPUT="${FILENAME::$((${#FILENAME} - 3))}" # same outcome, but working syntax