LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2011, 03:40 PM   #1
Chupakabra
LQ Newbie
 
Registered: Jul 2011
Posts: 12

Rep: Reputation: Disabled
if statements


I'm writing a script that takes a filename as an input argument and determines if the file is a normal file, or directory; and prints out the permissions of the file.

so far i have this ( my script isn't completed yet but i dont understand why the READ=r ( the r is yellow) WRITE=write ( the write is white ) EXECUTE=exec ( exec is yellow ) why is write white while the others are yellow )

this is just part of the script but i'm not sure why the colors are different



# Check for read permissions
if [ -r "$FILENAME" ]
then
READ=r r is yellow on this line
fi

# Check for write permissions
if [ -w "$FILENAME" ]
then
WRITE=write write is white on this line
fi

# Check for execute permissions
if [ -x "$FILENAME" ]
then
EXECTUE=exec exec is yellow on this line
fi


please exuse the spelling errors in this question
 
Old 07-28-2011, 04:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
That just sounds like VI syntax highlighting?!? Why do you care?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] if statements wtruong Programming 1 01-07-2010 03:56 PM
if else statements 0.o Programming 7 09-27-2005 02:59 PM
if statements and case statements not working in bourne shell script mparkhurs Programming 3 06-12-2004 02:41 AM
How do I use X =< Y w/ IF statements? dolvmin Linux - Software 11 09-24-2003 10:39 PM
if then statements vapor Programming 4 07-16-2003 06:44 AM


All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration