Linux.com

pbulteel

pbulteel

  • Linux.com Member
  • Posts: 2
  • Member Since: 21 Jul 10
  • Last Logged In: 19 Jan 11

Latest Posts

Posted by
Topic
Post Preview
Posted
  • pbulteel
    RE: ssh read output
    Why not just [code] #!/bin/sh cat /mnt/imageOutput.txt [/code] Why are you echoing the output of cat? (Which itself is basically "echoing" the text file?) -- Patrick
    Link to this post 22 Jul 10

    Why not just


    #!/bin/sh
    cat /mnt/imageOutput.txt

    Why are you echoing the output of cat? (Which itself is basically "echoing" the text file?)

    --
    Patrick

  • pbulteel
    RE: ssh - execute the script remotely / File not found
    Another thing is that it's best practice to include the full path to the application your are running in your scripts. #!/bin/bash /path/to/ec2-create-volume --size 10 --availability-zone us-east-1a The error you're seeing is probably that it cannot find the ec2-create-volume application. If you're going to automate applications that are going to run remotely it's a good idea to define the environment variables you want for any script. you could create a env.sh which contains PATH, etc and in every script include it. #!/bin/bash source /root/env.sh /path/to/command Check exit codes to do anything if things go wrong, and return an exit code when your script finishes. By creating an env.sh that you can then incorporate it into all your scripts that you make afterwards and know that you've taken care of everything. -- Patrick
    Link to this post 22 Jul 10

    Another thing is that it's best practice to include the full path to the application your are running in your scripts.

    #!/bin/bash
    /path/to/ec2-create-volume --size 10 --availability-zone us-east-1a

    The error you're seeing is probably that it cannot find the ec2-create-volume application.

    If you're going to automate applications that are going to run remotely it's a good idea to define the environment variables you want for any script.

    you could create a env.sh which contains PATH, etc and in every script include it.

    #!/bin/bash
    source /root/env.sh
    /path/to/command

    Check exit codes to do anything if things go wrong, and return an exit code when your script finishes.

    By creating an env.sh that you can then incorporate it into all your scripts that you make afterwards and know that you've taken care of everything.

    --
    Patrick

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board