rm: cannot remove ‘/mnt/live/memory/images/changes/home/guest/.config/google-chrome/Default/Session’: No such file or directory
rm: cannot remove ‘Storage/.wh.000004.log’: No such file or directory
rm: cannot remove ‘/mnt/live/memory/images/changes/home/guest/.config/google-chrome/Default/Session’: No such file or directory
rm: cannot remove ‘Storage/.wh.000003.log’: No such file or directory

rm: cannot remove ‘/mnt/live/memory/images/changes/home/guest/.config/google-chrome/Default/Session?Storage/.wh.000004.log’: No such file or directory
rm: cannot remove ‘/mnt/live/memory/images/changes/home/guest/.config/google-chrome/Default/Session?Storage/.wh.000003.log’: No such file or directory

Bogomips wrote:Between digression and ingression got completely lost. Couldn't see the wood for the trees. Still can't.

Sorry, it's complex, and seems I not realized what I could have been left out... I try again, hopefully this time I manage better. (I also removed quite some unneeded text in my above post)

You can boil it down to this:

I want to call mc (via a script) with 2 paths. So that mc opens these "target path" in its left and right working panel, one is the source directory for backup copy, the other the target. The target directory in /tmp varies since I give it a name including version and date so that I can have several versions next to each other.

Both have whitespace. One also has a wildcard. (The one in /tmp)

The path with only whitespace you can enclose in " ". (In my example, the one in /home/rava, but could be anywhere with a needed path with whitespace)

The other one, you cannot use " " to protect the whitespaces, or else the wildcard * won't expand.

the above would match, like I demonstrated with bash in my above post.

But when you try the same in a bash script, it fails. You get an "file or folder not found", or such error.

Like I said above, using " " won't work, since the * won't expand.
Using "\ " (minus the " ) also not works, the bash script complains about "path not found", even when the same works fine in bash itself....

That's boiled down to the basics. Well, at least I found a 2 part work around as quoted above, but I would prefer a solution in being able to give such wildcard and whitespace folder or filename and the script is able to expand the wildcard(s) while still respecting the whitespaces.

Only ONE of these base folders are meant to exist at a time, since usually you do only run one Porteus at a time. At least that's how it is planned to be intended to be used for now. And the "date" part of the name is meant to reflect the current date.

Now the issue is, how can I address such folder, needing a wildcard * at one part to match the variants, but also needs to address the whitespaces that follow?

Like I wrote in my initial post, the only work around the * AND whitespace in one folder name issue is by doing this trick:

cd $path1 # no masking so that * is expanded, CAVE! This part of the path given *must* *not* have whitespaces (it can expand, via the * to include whitespaces, but not in front or after the *)
cd "./${path2}" # masking for whitespace
. /usr/share/mc/bin/mc-wrapper.sh . "$path2" # masking for whitespace

I use two instances of cd to change into the wanted target folder, and then just use "." to start one panel of mc in that very folder and "$path2" for the other panel.

$path2 is the path with only whitespace, but without the need or a wildcard *

And now, when I ponder about it I do get it why using a variable was the issue, cause doing so gives you the need to protect the whitespaces. Using no variable: no such need. AT least not in the very same way, when including the need of expanding the wildcard.

And again the behaviour of bash and of a bash script is the same.

All is well.
Like Dutch from Black lagoon used to say "Hallelujah and Peanut Butter!"

Black Lagoon, the anime for folks who not care or even dislike anime.

Also an anime for folks who usually dislike brutal stuff, but many of these still enjoy Black Lagoon cause it is just that good of a show.</digress>

Hmmm why not open up a thread where we can chat about which media / series / manga / fanfiction we like, and why?
Anyone interested?