| | |
script not working in RedHat Linux.
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi All,
The following script checks whether the filename is correct then the script proceeds to check whether you have read,write and execute permisiions to the file and displays an approriate message.
when i run this script and give the filename 'test' it is showing the following error.
i have seen this program in a shell scripting book and tried it but it has shown the above said error. '-z ' returns true if the lenght of the string is zero(this could be in Unix). what would be the equivalent command in Redhat linux. I am using Redhat llinux 9 version.
Please advice.
Thanks
Srini...
The following script checks whether the filename is correct then the script proceeds to check whether you have read,write and execute permisiions to the file and displays an approriate message.
Shell Scripting Syntax (Toggle Plain Text)
#ss23 #usage ss23 echo "enter any filename \c" read fname if[!-z "$fname"] then if [-r $fname -a -w $fname -a -x $fname] then echo you have read,wirte and execute permisions to $fname else echo read,write and execute permisions denied fi else echo improper filename fi
when i run this script and give the filename 'test' it is showing the following error.
•
•
•
•
s23:line 3: if[!-z test]: command not found
s23:line 4: if [-r test -a -w $fname -a -x test] : command not found
s23:line 5:syntax error near unexpected token 'then'
Please advice.
Thanks
Srini...
![]() |
Similar Threads
- How to Configure Samba on RedHat Linux (*nix Hardware Configuration)
- Change Password In A Shell Script (Shell Scripting)
- Cr4nberry: How to Configure Samba on RedHat Linux (*nix Software)
- Debian Linux xserver configuration (Window and Desktop Managers)
- script for search SUID/GUID ! (Shell Scripting)
- How to Configure Samba on RedHat Linux (*nix Software)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Red Hat Linux Webserver Configurations (*nix Software)
Other Threads in the Shell Scripting Forum
- Previous Thread: Transfer files from ftp1 to ftp2
- Next Thread: Sed Awk Bash Grep Ip Address from logs
| Thread Tools | Search this Thread |





