The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sigempty what means? Puntino UNIX for Dummies Questions & Answers 1 04-28-2008 05:44 AM
what these statements means namishtiwari UNIX for Dummies Questions & Answers 1 01-16-2008 10:20 PM
what it means? rraajjiibb UNIX for Dummies Questions & Answers 4 08-31-2004 10:36 AM
What does ##* means yeheyaansari UNIX for Advanced & Expert Users 2 02-14-2002 05:39 AM
what is means by tar xvr - E-Quality UNIX for Dummies Questions & Answers 2 09-24-2001 06:48 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-05-2008
Registered User
 

Join Date: Oct 2007
Posts: 59
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
What does ls /nosuchdir means ???

I do have a segment in my code like follows:

if [ condition ] then
ls /nosuchdir
fi


what does the ls /nosuchdir means ??
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-05-2008
joeyg's Avatar
premier etoile de match
 

Join Date: Dec 2007
Location: Home of world champion Boston Celtics
Posts: 419
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
provide listing of files

The ls /nosuchdir command will give a listing of files in the /nosuchdir directory. Beware, since the directory is preceded by the / means that you are looking to the root of your system and not referencing from where you are currently.
Reply With Quote
  #3 (permalink)  
Old 02-05-2008
Registered User
 

Join Date: Oct 2007
Posts: 59
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Hi joeyg

I doubt whether you are aware /nosuchdir ...
"nosuchdir" is not a directory .. Its a concept in shell scripting..

So please let me know that...
Reply With Quote
  #4 (permalink)  
Old 02-05-2008
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 2,983
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by risshanth View Post
I doubt whether you are aware /nosuchdir ...
"nosuchdir" is not a directory .. Its a concept in shell scripting..

So please let me know that...
hmmm... what 'concept' is that?
Reply With Quote
  #5 (permalink)  
Old 02-05-2008
Dave Miller's Avatar
Registered User
 
Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 140
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Here's a shot in the dark:

Since the file doesn't exist, the 'concept' is a quick and easy method of producing output that also affects the error flags.
Reply With Quote
  #6 (permalink)  
Old 02-05-2008
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 2,983
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by Dave Miller View Post
Here's a shot in the dark:

Since the file doesn't exist, the 'concept' is a quick and easy method of producing output that also affects the error flags.
I'm not sure I can 'parse' what's being said here!
Could you elaborate, pls?!
Reply With Quote
  #7 (permalink)  
Old 02-05-2008
joeyg's Avatar
premier etoile de match
 

Join Date: Dec 2007
Location: Home of world champion Boston Celtics
Posts: 419
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Smile Is this some kind of trick question?

Check for a condition
If the condition is true
Then list files in the directory

Perhaps the vagueness, or "conceptualness", is confusing people

Provide actual script code
Reply With Quote
  #8 (permalink)  
Old 02-05-2008
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,439
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
I'm as confused as vgersh99 here, I don't see any concept here nor do I see any logic to a such a redundant piece of code.
Reply With Quote
  #9 (permalink)  
Old 02-05-2008
Registered User
 

Join Date: Oct 2007
Posts: 37
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Even i do agree....
I have not read these concepts in any bash shell scripting guide.
Could you please clarify in detail ?
Reply With Quote
  #10 (permalink)  
Old 02-06-2008
Registered User
 

Join Date: Oct 2007
Posts: 59
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Unhappy Hi..

My script is as follows:

SRC=$INPUT_FILE
SIZE=$(cksum $SRC | awk '{print $2}')
if [[ $SIZE < 1 ]] ; then
ls /nosuchdir
fi


The $INPUT_FILE is received as an argument to this script. This was developed by somebody else. So I am trying to understand the code. I got confused when i saw "ls /nosuchdir" . There will never be a directory under name "nosuchdir" in the whole file system. So what does this mean ??

I heard that people will use like this, and there is some concept behind this. Even I too don't know about hat and much confused...

So, please friends help me out...
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive gzip password hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 02:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101