Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Thanks. Is the shell created by bash -i -c interactive or non-interactive? Also see the example bash -c -i "cp .file1 file2" and bash -c "cp .file1 file2" in unix.stackexchange.com/a/276611/674 Commented Apr 18, 2016 at 4:53
  • The difference is a result of the fact that bash seems to read $ENV in case it is called with the -i option. Inside the $ENV file, there seem to be alias definitions for cp that replace cp by something like cp -i. BTW: there is currently a discussion whether POSIX should forbid aliases to be turned on in scripts with POSIX issue 8 that will start it's development around autumn 2016. Commented Apr 18, 2016 at 11:48