Ok, that is good to know. For what it’s worth, ucybdbldsuccessfully loaded a transport case that had many paths with one missing set of braces, e.g.,
O\APPS{}\UC0\MAL{}\TEST{}\JSCH{}
I discovered, however, that the script you wrote is unable to properly read paths like this. Specifically, theread in the script appears to parse the backslashes as escape characters, which causes the variablexto contain something like this:
OAPPS{}UC0MAL{}TEST{}JSCH{}
The regexp replaces matched pairs of curly braces (containing any number of non-curly-brace-characters) with slashes, so it results in output like this:
0100 JSCH UC0.MAL.JSCH2 /APPS/UC0MAL/TEST/JSCH/
I do not know a good way around this problem. If you can think of something, please let me know.
For now, where I just need a list of all of the folders in the transport case, I will use a simpler method that avoids the problem by never reading the line into a variable, and by replacing actual backslashes with slashes instead of relying on the presence of matched pairs of curly braces.
awk '/^O/ {print $1}' $trans | sort | uniq | sed -e 's/\\/\//g' | sed -re 's/\{(([^\{\}])*?)?\}//g' | cut -c2-
I will also try to move away from the simple sed-like replacements in our source code management system, and to use ucybchng instead. In the mean time, I will advise users not to change multiple levels of the folder path at once. The only drawback of this is that the matching will be less specific, and may change other folders by mistake.
Thanks again for your feedback and help.