Sven0 Sven0 - 15 days ago 6
Bash Question

loading files with leading zeros in ubuntu shell (pcl_viewer example)

i am trying to load several files in the

pcl_viewer
. But this question is more general about the Linux shell i guess. I am using Ubuntu 16.04.

The problem i have is that the filenames have many leading zeros.

The following works:
pcl_viewer fileBasename_00000[0-9].pcd


But i cannot load files like:
fileBasename_00000[0-10].pcd.


i have tried
fileBasename_00000[00-10].pcd
or
fileBasename_00[000-250].pcd
or
fileBasename_00[*].pcd


Is there a space holding character which i can use to tell the shell that the filename has many leading zeros?

Many thanks!

Answer

I suggest to use bash‘s brace expansion instead of globbing:

pcl_viewer fileBasename_00000{0..10}.pcd
Comments