LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-16-2003, 09:44 PM   #1
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
bash script test file operators...


I am reading my gentoo init scripts, and in the one for hdparm I see this construct quite a few times:
Code:
if [ -n "${all_args}" ]
Neither the advanced bash sripting guide nor the manpage for 'test' have any reference to an "-n" operator.

Can anyone tell me what it is testing for?
 
Old 10-16-2003, 10:22 PM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
-n tests for is string is not null. it's actually in the advanced bash scripting guide under string comparisons.
 
Old 10-16-2003, 11:08 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
Jeez...sorry, guess I should have turned the page (so to speak..)

Thanks...
 
Old 10-17-2003, 12:06 PM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
It actually is in "man test" as well. When you search for -n the first hit gets you there....
 
  


Reply



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
bash script 'test' question linmix Programming 5 11-29-2005 11:49 AM
Bash Script test for empty dir uopjohnson Linux - Software 3 10-07-2005 06:45 PM
? on logical operators in BASH eroica Linux - Software 10 02-01-2005 01:12 PM
Simple webserver test script (bash) somedudeppf Programming 3 01-14-2004 10:30 AM
benchmark test bash script PTBmilo Programming 3 02-14-2003 04:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:02 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
Open Source Consulting | Domain Registration