I am trying to do the following in ksh shell:JMX_ROOT=/bfs-build/build-info/mep_mainline-Linux.latest/core/mainline/automationSMOKE_JMX_LOCATION=$JMX_ROOT/\Smoke Set\/*.txt $JMX_ROOT/\Smoke Set\/*.TXT $JMX_ROOT/\Smoke Set\/SmokeSet.jmxcp $SMOKE_JMX_LOCATION /var/tmpI.e. copy .txt, .TXT and .jmx files from one directory to another directory but am getting errors because of the spaces in Smoke Set.Any help is much appreciated.
Concatenate multiple strings with spaces in them?
shell script;scripting;ksh
You generally can't put several paths in a single string, because anything* which is a valid string is also a valid path in most file systems. You could use an array:JMX_ROOT=/bfs-build/build-info/mep_mainline-Linux.latest/core/mainline/automationset -A SMOKE_JMX_LOCATIONS $JMX_ROOT/Smoke Set/*.txt $JMX_ROOT/Smoke Set/*.TXT $JMX_ROOT/Smoke Set/SmokeSet.jmxcp ${SMOKE_JMX_LOCATIONS[@]} /var/tmp* Before anyone protests about \0 and /, the former can't be part of a variable (at least if ksh works like Bash; couldn't find a reference), and the latter can't be part of file names, but it's very much valid in paths.