![]() tmp/countfile.sh => This line calls the countfile.sh file AND returns the output in the same shell. But for this example you would not need it. I just added the “bc” command which is used to convert to an integer value. ![]() ls –l /tmp | wc –l | bc => Will count the files in the /tmp directory.#!/bin/bash => Which shell executes this script.sh ending, these are just plain text files). In the /tmp directory I created two text files countfile.sh and runcount.sh (don’t get confused about the. A Linux guy might creates a script or he might asks you if you can execute a script which calls another script in Linux. But the real world is that most scripts on the Linux side are not just one-liner. The “ls –l” command is similar to the Windows “dir” command and then the output is sent to the “wc –l” command which counts the words by line (wc=word count). This example will count the files/directories in the /tmp directory. That means you just can call one command “one-liner” using the pipe symbol “|” e.g. This two state monitor allows you to call a shell script or a one-line command sequence (using pipeline operators). Here I would like to provide a cool, little way how to overcome a limitation of the Unix/Linux Shell Command Two (or Three) State Monitor. If you are a Windows guy and you haven’t touched Linux so far implementing SCOM will force you to get hands on *nix systems.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |