0

I am running following command in postinst script of custom dpkg package

mkdir -p /var/{cache,run,doc}

The command works but create single dir named /var/{cache,run,doc} not three seperate dirs in /var .

Is there any alternative to do this?

Thanks

2 Answers2

1

That's probably because you have declared that the maintainer script is a POSIX shell script with #!/bin/sh instead of a bash script with #!/bin/bash. The {} syntax is a bashism.

You either need to use bash, or spell each directory explicitly like:

mkdir -p /var/cache /var/run /var/doc

What I'm wondering though is why you need those, because at least on Debian and derivatives these directories (except /var/doc which is known as /usr/share/doc) are already provided by base-files.

Guillem Jover
  • 2,090
  • 2
  • 11
  • 16
0
mkdir -p /var/ cache run doc

Should do the job

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60