Aliases not working in the Pipeline

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Problem

Aliases not working in the Pipeline

1 2 3 4 5 alias listing="ls -lrt" listing

The above command returns command not found (or similar error)

Diagnosis

Check the value of expand-aliases in the Pipeline by running the following command before using the Alias

1 shopt

Verify the value of expand-aliasesis set to On.

Cause

Aliases by default not supported and enabled in the Bash. If the expand-aliasesis set to Off, the Aliases will not be expanded by default

Solution

Enable expand-aliases option before using the aliases using the following command

1 shopt -s expand_aliases
Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.