diff --git a/src/api/IBMiContent.ts b/src/api/IBMiContent.ts index 6b64152fb..b7c911a22 100644 --- a/src/api/IBMiContent.ts +++ b/src/api/IBMiContent.ts @@ -651,7 +651,9 @@ export default class IBMiContent { } async memberResolve(member: string, files: QsysPath[]): Promise { - const command = `for f in ${files.map(file => `/QSYS.LIB/${file.library.toUpperCase()}.LIB/${file.name.toUpperCase()}.FILE/${member.toUpperCase()}.MBR`).join(` `)}; do if [ -f $f ]; then echo $f; break; fi; done`; + // Escape names for shell + const fixed = files.map(f => ({name: f.name.replace(/([$\\])/g,'\\$1'), library: f.library.replace(/([$\\])/g,'\\$1')})); + const command = `for f in ${fixed.map(file => `/QSYS.LIB/${file.library.toUpperCase()}.LIB/${file.name.toUpperCase()}.FILE/${member.toUpperCase()}.MBR`).join(` `)}; do if [ -f $f ]; then echo $f; break; fi; done`; const result = await this.ibmi.sendCommand({ command,