#!/bin/sh # # This script prints out the names of all the files specified # on the command line ( command line arguments that are executable files). # for each file found to be executable an ls -l is run so the # long format is displayed for each executable file # # # uses an if command split over several lines. # The script loops over the command line parameters, checking each one # with the test command (inside an if command). # for i in $@; do # check to see if the named file is executable if test ! -x $i then ls -l $i else echo $i is executable fi done