Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

3.2.5.2. Auto-Executing a Command in the Nios II Command Shell

In certain situations, you might need to run a command or a script automatically after the Nios II Command Shell is initialized. When you start the Nios II Command Shell environment, to automatically execute a command perform one of the following steps, depending on your environment:
  • In the Windows operating system, execute the following command:

    “<Nios II EDS install path>/Nios II Command Shell.bat“ <command>

  • In the Linux operating system, execute the following command:

    <Nios II EDS install path>/nios2_command_shell.sh <command>

For example, in Windows, to run an automated build, you might execute the following command:

“<Nios II EDS install path>/Nios II Command Shell.bat custom_build.sh

The Nios II Command Shell startup script (Nios II Command Shell.bat or nios2_command_shell.sh) makes no special assumptions about its initial environment. You can use the Nios II Command Shell with auto-execution from any environment that accepts commands native to your host operating system. For example, in Linux you can use crontab to schedule a job to run in the Nios II Command Shell at a later time.