bashis run with
-c, it is considered a non-interactive shell, and it does not read
~/.bashrc, unless is
$ type cp cp is aliased to ‘cp -i’ # Defined in ~/.bashrc $ cp .file1 file2 cp: overwrite ‘file2’? n $ bash -c "cp .file1 file2" # Existing file is overwritten without confirmation! $ bash -c -i "cp .file1 file2" cp: overwrite ‘file2’? n
Is the shell created by
bash -i -c <command> interactive or non-interactive?
Such a shell doesn't accept a command from stdin, does it? So it is not interactive, is it?
Such a shell reads
~/.bashrc, so it can't be non-interactive, can it?