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 when you are in shell prompt then run it like below;

Then just paste the output under configuration command and commit!

One thought on “Simple shell script

  1. Kaacz

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


You have a feedback?