Re: Where to set up BASH_ENV?

From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 11/28/05


Date: Mon, 28 Nov 2005 03:06:16 -0500

On 2005-11-28, paulaugust2003@yahoo.com wrote:
> Hi,
>
> I am confused about setting up the environment variable BASH_ENV. What
> I want to achieve is that I can run a command in a remote machine in
> the following way:
>
> ssh username@remotemachine "some; commands;"
>
> However, it doesn't work because the commands I want to run remotely
> may contain aliases and other definitions that are only available if I
> login the remote machine interactively. Okay, since bash is my shell, I
> try the following way:
>
> ssh username@remotemachine "bash -c 'some; commands;'"

    Pipe your commands to ssh:

printf "%s\n" ". ~/.bashrc" alias | ssh username@remotemachine

-- 
   Chris F.A. Johnson, author   |    <http://cfaj.freeshell.org>
   Shell Scripting Recipes:     |  My code in this post, if any,
   A Problem-Solution Approach  |          is released under the
   2005, Apress                 |     GNU General Public Licence


Relevant Pages

  • Re: ":-" operator/builtin help
    ... On 2005-08-03, Deepak wrote: ... > # If no filename specified on command line, ... Here is the relevant section from the bash man page: ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: LPI Linux Level 1 Exam 102 Question
    ... A lpr -o delete foobar.txt ... What is the purpose of the Bash built-in export command? ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.os.linux.misc)
  • Re: clear shell after a command like "vi"
    ... exists, but for some-one who uses a PC with the console and bash, ... after one used the "vi" the editor, the screen is still full with ... after every command: ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.os.linux.misc)
  • Re: How to do a file find in bash ?
    ... I use the 'locate' command. ... To manually update the database, ... algorithm as bash" ... Shell Scripting Recipes: | My code in this post, if any, ...
    (alt.os.linux)
  • Re: how to rescue from "rm /usr/bin -fr"
    ... when I use scp in localhost, ... bash: scp: command not found ... Is there no one at this remote machine that could insert a rescue CD and start it? ...
    (comp.os.linux.networking)