Skip to content
Advertisement

Converting from batch to shell

I have a set of batch commands that I’m trying to convert to shell so I can use them on my linux environment. The command should read

rcontrib -y  < viewinside_NE.rays -o result/%%04d_inside

In windows (using batch), running this command should produce a set of files that are numbered like this:

0001_inside.hdr 0002_inside.hdr etc.

However, when I ran this command in bash, I expected to get eight files with names that start with 0001 to 0008 but I got only one file which was named 0001_inside. How would I do this in bash? Please note: rcontrib is a command that is part of a package that runs on both linux and windows

If you like this question please vote up.

Advertisement

Answer

I think %%04d is to escape ‘%’ in DOS, your rcontrib program probably wants %04d like in c syntax to name the file with a 4 digit integer. In bash you don’t need to escape it, have you try this?

rcontrib -y  < view/inside_NE.rays -o result/%04d_inside
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement