Sep 02









So, you want to write a unix script that accepts incoming data as argments into a unix/linux shell script.  You’ve come to the right place.  just follow the step by step instructions below on how to put incoming arguments into your scripts:

Step 1:

Write a unix shell script to pass an argument that will look for a process, with the name of the process being your argument.

###BEGIN SCRIPT###

###SCRIPT NAME:  chkps.sh ###

#!/bin/bash

argument1=$1  ###This is your incoming argument.

ps -ef | grep $argument1  ###This is your command using the argument.

###END SCRIPT###

Step 2:

Using the script that you just wrote.  From a command line you would need to do the following:

chkps.sh something

This script will now search for the process something.

Leave a Reply

preload preload preload