Hi all,
I want to use some commands and I wrap them into an array, like follows:
set ALIAS_AR = ( "ls -ltr|wc -l" \
"ps -ef|grep -v grep |grep tty|wc -l" \
"who|wc -l" )
Then I use a while loop to call every step:
set no = 1
while ( $no <= $#ALIAS_AR )
if ( `$ALIAS_AR[$no]` == 7 ) then
echo "true"
else
echo "False"
endif
@ no++
end
And the script can't be ran as there are several problems, like
ls: invalid option -- '|'
Can anyone give me a suggestion about this?
PS: the above code is just demo, I want to use the pre-stored command to retrieve the status of running time.
Thanks