ssh redirect output of Unix pwd command to a file il the local server

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Script abcd.sh:



####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
export  pathofremote
#####


Running abcd.sh:



-bash:./abcd.sh
pathofremote: command not found

remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied


While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote



Also I am not able to save the output of the file to another file in the localserver.







share|improve this question


















  • 5




    At a minimum, remove the space between pathofremote and =
    – user4556274
    Oct 16 '17 at 14:31














up vote
0
down vote

favorite












Script abcd.sh:



####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
export  pathofremote
#####


Running abcd.sh:



-bash:./abcd.sh
pathofremote: command not found

remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied


While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote



Also I am not able to save the output of the file to another file in the localserver.







share|improve this question


















  • 5




    At a minimum, remove the space between pathofremote and =
    – user4556274
    Oct 16 '17 at 14:31












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Script abcd.sh:



####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
export  pathofremote
#####


Running abcd.sh:



-bash:./abcd.sh
pathofremote: command not found

remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied


While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote



Also I am not able to save the output of the file to another file in the localserver.







share|improve this question














Script abcd.sh:



####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
export  pathofremote
#####


Running abcd.sh:



-bash:./abcd.sh
pathofremote: command not found

remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied


While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote



Also I am not able to save the output of the file to another file in the localserver.









share|improve this question













share|improve this question




share|improve this question








edited Oct 16 '17 at 14:31









Stephen Rauch

3,248101227




3,248101227










asked Oct 16 '17 at 14:22









user254860

1




1







  • 5




    At a minimum, remove the space between pathofremote and =
    – user4556274
    Oct 16 '17 at 14:31












  • 5




    At a minimum, remove the space between pathofremote and =
    – user4556274
    Oct 16 '17 at 14:31







5




5




At a minimum, remove the space between pathofremote and =
– user4556274
Oct 16 '17 at 14:31




At a minimum, remove the space between pathofremote and =
– user4556274
Oct 16 '17 at 14:31










1 Answer
1






active

oldest

votes

















up vote
2
down vote













Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.



foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398430%2fssh-redirect-output-of-unix-pwd-command-to-a-file-il-the-local-server%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.



    foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
    foo=bar # This will set the variable 'foo' equal to 'bar'
    foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'





    share|improve this answer
























      up vote
      2
      down vote













      Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.



      foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
      foo=bar # This will set the variable 'foo' equal to 'bar'
      foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'





      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.



        foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
        foo=bar # This will set the variable 'foo' equal to 'bar'
        foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'





        share|improve this answer












        Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.



        foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
        foo=bar # This will set the variable 'foo' equal to 'bar'
        foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 16 '17 at 15:54









        DopeGhoti

        40.7k54979




        40.7k54979



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398430%2fssh-redirect-output-of-unix-pwd-command-to-a-file-il-the-local-server%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)