Junos OS

 View Only
last person joined: 2 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  get switchname as variable

    Posted 08-16-2021 09:04

    Hello,

     

                   I am looking for a quick way to do the following:

    ·        This is my switch..... root@mrct-nddn-02- >

    ·        This is a text file on my switch ..... testData

    ·        I want to issue a Junos or Linux command to do the following:  rename "testdata" as "mrct-nddn-02_testData"

     

    Is there a quick Junos or Linux way to get my switch name and append it to the file name ?

     

    Thanks

    Michel lapointe



  • 2.  RE: get switchname as variable

     
    Posted 08-16-2021 14:39
    root@switch:RE:0% touch test
    root@switch:RE:0% mv test test-`hostname`
    root@switch:RE:0% ls -la test*
    -rw-r--r-- 1 root wheel 0 Aug 16 18:26 test-switch



  • 3.  RE: get switchname as variable

    Posted 08-17-2021 05:30
    simple, and to the point. Thank you
    Michel

    ------------------------------
    Michel Lapointe
    ------------------------------