Simple shell script

When I was looking at one of my earlier posts, I noticed that sometimes I do repeat cli commands manually instead of scripting. Life is short! If you can’t find any other shell, junos has also C shell and following is a simple loop which generates several commands following a similar pattern. For example I would like to delete all ethernet-switching families
in one go in an SRX210 device. Then write the following lines into a file named junos.sh when you are in shell prompt then run it like below;

Then just paste the output under configuration command and commit!

1 thought on “Simple shell script

  1. Kaacz

    Or simply redirect it to “cli” with “configure private” in first and “commit” in last line. 🙂

    Reply

You have a feedback?

This site uses Akismet to reduce spam. Learn how your comment data is processed.