One way (and far from the only way) to do this would be to echo each filename to be added to the "bundle" and pipe the output to grep/egrep/fgrep to search for the "/" character. If the output is non-NULL, the filename contains one or more "/" characters. If the output is NULL, the filename does not contain "/" characters.
Since you don't mention the scripting language you're using, I've assumed bash-compatible. Examples:
echo "/usr/bin/ls" | egrep "/" (produces /usr/bin/ls)
echo "holy regular expression Batman" | egrep "/" (produces no output)
The return codes from the two examples are also different -- another way to test the result.
Hope this helps.
__________________ The slowest component still sits at the keyboard. |