# Linux script question

**URL:** <https://kopia.discourse.group/t/linux-script-question/1978>\
**Category:** Support\
**Created:** [April 21, 2023, 7:41am UTC](https://kopia.discourse.group/t/linux-script-question/1978 "2023-04-21T07:41:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![highend](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@highend](https://kopia.discourse.group/u/highend)\
**Post date:** [April 21, 2023, 7:41am UTC](https://kopia.discourse.group/t/linux-script-question/1978/1 "2023-04-21T07:41:47Z")

</div>

This doesn’t work, the config file isn’t created

```auto
localRepoPath="/mnt/int_02_crypt/backup"

repoOpts="--config-file=\"/root/.config/kopia/repository_local.config\" "
repoOpts+="--no-check-for-updates "
repoOpts+="--block-hash=BLAKE3-256-128"

kopia repository create filesystem --path="${localRepoPath}" $repoOpts

```

This works (but I’d prefer to create a list of options by concatenating^^):

```auto
localRepoPath="/mnt/int_02_crypt/backup"

repoOpts="--no-check-for-updates "
repoOpts+="--block-hash=BLAKE3-256-128"

kopia repository create filesystem --path="${localRepoPath}" --config-file="/root/.config/kopia/repository_local.config" $repoOpts

```

Any idea how to get the first version to work as expected?

---

<div class="post-metadata">

**Author:** ![ted](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@ted](https://kopia.discourse.group/u/ted)\
**Post date:** [April 22, 2023, 3:38am UTC](https://kopia.discourse.group/t/linux-script-question/1978/2 "2023-04-22T03:38:42Z")

</div>

Try:  
`repoOpts="--config-file=/root/.config/kopia/repository_local.config "`

---

<div class="post-metadata">

**Author:** ![highend](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@highend](https://kopia.discourse.group/u/highend)\
**Post date:** [April 25, 2023, 2:52pm UTC](https://kopia.discourse.group/t/linux-script-question/1978/3 "2023-04-25T14:52:16Z")

</div>

Thanks ted.

Ofc this would work. But what if a path contains a space or a char that would need to be escaped (like a “@” or “!”)?

Because I’d like to do the same for e.g. the

```auto
--cache-directory=

```

option e.g. like this:

```auto
kopiaCache="/mnt/int_02_crypt/!caches"
localRepoCache="${kopiaCache}/!repository_local"
...
repoOpts+="--cache-directory=\"${localRepoCache}\" "
...

```

and this wouldn’t work with just removing the escaped quotation marks…

---

<div class="post-metadata">

**Author:** ![highend](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@highend](https://kopia.discourse.group/u/highend)\
**Post date:** [April 25, 2023, 8:13pm UTC](https://kopia.discourse.group/t/linux-script-question/1978/4 "2023-04-25T20:13:30Z")

</div>

Seems this is too complicated…

I’ll use something like this:

```auto
kopia repository create filesystem --path="${localRepoPath}" --config-file="${cfgFile}" --cache-directory="${localRepoCache}" ${repoOpts}

```

Where `${repoOpts}` only contains those options that don’t require a path / any escaping in a string…
