git @ Cat's Eye Technologies Dipple / master sh / backticks-on-function.sh
master

Tree @master (Download .tar.gz)

backticks-on-function.sh @masterraw · history · blame

#!/bin/sh

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

translate() {
    if [ "X$1" = "Xfoo" ]; then
        echo "bar"
    elif [ "X$1" = "Xwhee" ]; then
        echo "WHEE"
    else
        echo $1
    fi
}

FILE=`translate $1`
echo $FILE