问题描述:

I have a text file of roughly 900 cURLs to run. They are pretty hairy, with tons of quotes, apostrophes and other special characters.

To run them I have been trying to create a bash script to loop through the list:

#!/bin/sh

OLDIFS=$IFS

IFS="&&&"

echo "getting started"

cat staging_curl_script|while read line

do

$line

done

echo "done"

Unfortunately I have had an unusual issue. commands that run fine in the command prompt are returning the "file name too long" error. I echoed out these commands from the script and compared them to the manually run command, and they are identical.

Any idea why I am seeing different results?

网友答案:

silly mistake here, needed bash -c "$line"

相关阅读:
Top