

пишим скрипт
nano ifscript1
#!bin/bash
echo «aru you hungry»
read VALUE
if [ $VALUE = «YES» ];
then
echo «make some dinner»
else
echo «working»
fi
ls -l
-rw-r—r— 1 root root 116 Apr 28 19:37 ifscript1
chmod u+x ifscript1 делаем файл исполняемым
ls -l
-rwxr—r— 1 root root 116 Apr 28 19:37 ifscript1

cp ifscript1 ifscript2
chmod u-x ifscript2
[root@cent1 andrey]# ls -l
total 8
-rwsr—r— 1 root root 121 Apr 28 19:51 ifscript1
-rw-r—r— 1 root root 121 Apr 28 19:59 ifscript2
[root@cent1 andrey]# test -x ifscript1
[root@cent1 andrey]# echo $?
0
[root@cent1 andrey]# test -x ifscript2
[root@cent1 andrey]# echo $?
1