The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell Script Required? Pls. help me ntgobinath Shell Programming and Scripting 22 05-29-2008 08:09 AM
Shell Script Required! vats Shell Programming and Scripting 3 08-28-2007 03:29 AM
shell script required sethunath Linux 1 07-07-2007 06:04 AM
shell script required sethunath Shell Programming and Scripting 4 07-06-2007 04:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-16-2008
max29583 max29583 is offline
Registered User
  
 

Join Date: Dec 2006
Location: UK
Posts: 33
Shell script help required

Hi,

Can someone help me with this small piece of code.

DIRNAME=$(dirname $0)
BASENAME=$(basename $0)
DATA="${DIRNAME}/${BASENAME}.data"
[ -r $DATA ] && . $DATA

whats is meant by [ -r $DATA ] && . $DATA here...

Regards,
Abhishek

Last edited by max29583; 07-16-2008 at 07:20 AM.. Reason: Missed my name at the end....
  #2 (permalink)  
Old 07-16-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,930
If $DATA exists and is readable, source (read) the file $DATA and include its contents in the current shell script
  #3 (permalink)  
Old 07-16-2008
max29583 max29583 is offline
Registered User
  
 

Join Date: Dec 2006
Location: UK
Posts: 33
Ok.....
so this is a condition but without an "if ... fi" block?


Thanks for the help friend.

Regards,
Abhi
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0