-3

I want to run some alias command in bash's non-interactive mode. But seems Ubuntu ignore BAHS_ENV. How can I make it work? la is a alias command. And I tested in other linux. it is work fine. Just Ubuntu not work.

BASH_ENV=~/.profile bash -O expand_aliases -c la

4

1 回答 1

0

我刚刚登录了一个 Ubuntu 机器(12.04.1),它工作正常:

创建一个test_bash_env包含以下脚本的文件:

#!/bin/bash

echo "This is a test for BASH_ENV, the value of which is: \`$BASH_ENV'"

然后,我们很高兴有:

gniourf@ubuntubox:~/Test$ BASH_ENV=./test_bash_env bash -c 'echo "Hello, BASH_ENV!"'
This is a test for BASH_ENV, the value of which is: `./test_bash_env'
Hello, BASH_ENV!

你拼错了变量还是什么?

于 2012-12-02T18:34:48.753 回答