# Shell Compatibility Issue in Nexus Repository 3.78.2-04 Startup Script

**URL:** <https://community.sonatype.com/t/shell-compatibility-issue-in-nexus-repository-3-78-2-04-startup-script/14660>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository\
**Created:** [March 20, 2025, 7:53pm UTC](https://community.sonatype.com/t/shell-compatibility-issue-in-nexus-repository-3-78-2-04-startup-script/14660 "2025-03-20T19:53:57Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![lemonsterfy](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@lemonsterfy](https://community.sonatype.com/u/lemonsterfy)\
**Post date:** [March 20, 2025, 7:53pm UTC](https://community.sonatype.com/t/shell-compatibility-issue-in-nexus-repository-3-78-2-04-startup-script/14660/1 "2025-03-20T19:53:57Z")

</div>

## Environment

- Nexus Repository: 3.78.2-04 (Community Edition)
- OS: Debian 12.10

## Issue

During service startup, the following error appears:

```auto
/opt/nexus-3.78.2-04/bin/nexus: 155: [[: not found

```

## Root Cause

The startup script (`bin/nexus`) uses bash-specific syntax with `/bin/sh` shebang:

```sh
#!/bin/sh
# ...
if [["$data_dir" != /*]]; then # Line 155
  data_dir="$PARENT/$data_dir"
fi

```

On systems where `/bin/sh` links to a POSIX-compliant shell like dash, the `[[` syntax is unsupported.

## Reproduction

Standard startup via systemd produces the error:

```auto
Mar 20 21:33:46 host systemd[1]: Starting nexus.service - nexus service...
Mar 20 21:33:46 host nexus[92263]: /opt/nexus-3.78.2-04/bin/nexus: 155: [[: not found
Mar 20 21:33:46 host nexus[92263]: Starting nexus
Mar 20 21:33:46 host systemd[1]: Started nexus.service - nexus service.

```

## Proposed Solutions

1. Change shebang from `#!/bin/sh` to `#!/bin/bash`

2. Replace bash-specific syntax with POSIX-compliant case statement:

## Impact

The issue does not prevent service operation but generates unnecessary warnings during startup.

---

_[View the full topic](https://community.sonatype.com/t/shell-compatibility-issue-in-nexus-repository-3-78-2-04-startup-script/14660)._
