Passa al contenuto principale

5. Testing the example

  1. Let's see the usage of the program:

    ./sys_info.sh -h
    ./sys_info.sh --help
  2. We see that we can also call it without any parameters. Let's try it:

./sys_info.sh
./sys_info.sh > report1.html
lynx report1.html

Exit with qy

  1. We can write the output to a file using the option -f or --file:

    ./sys_info.sh -f report2.html
    cat report2.html
    ./sys_info.sh --file report3.html
  2. Let's also try the interactive method:

    ./sys_info.sh -i
    • Enter the name of the output file as report1.html
    • Press n for not overwriting the existing file.
    • Enter the new name of the output file as report2.html
    • Press y for overwriting the existing file.
     
    ./sys_info.sh --interactive
    • Enter the name of the output file as report3.html
    • Press n for not overwriting the existing file.
    • Enter the new name of the output file as report4.html
     
    lynx report4.html

    Exit with qy

Loading asciinema cast...