LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 05-26-2016, 12:06 PM   #1
henryco
LQ Newbie
 
Registered: May 2016
Posts: 2

Rep: Reputation: Disabled
a piece a chinese/linux code


Hi,

I was not able to figure out the meaning of this script line :

[ -h default.pa -o ! -e default.pa ] || exit 0

default.pa is a file , my problem is with the expression inside the []

thank you for any help
 
Old 05-26-2016, 12:16 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,551

Rep: Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862Reputation: 862
Presuming a shell script (from 'man test')

-h = -L = file exists & is a symlink
! -e = file exists (presumably not a symlink)

Don't know if that will work. make default.pa a symlink.
 
Old 05-26-2016, 12:17 PM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
see man test:

-h file: True if file exists and is a symbolic link.
-e file: True if file exists.
 
Old 05-26-2016, 12:28 PM   #4
henryco
LQ Newbie
 
Registered: May 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
thank you !
 
  


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
Help please: Want to write this piece of code without using malloc Nenita Programming 12 11-14-2014 02:46 PM
[SOLVED] Can we reduce the piece of code santosh0782 Linux - Newbie 5 08-20-2014 06:38 PM
Posting piece of code on the internet vinians Linux - Newbie 2 10-03-2009 08:53 PM
piece of code Volcano Programming 8 08-04-2009 10:28 AM
nice piece of code ....HOW DOES IT WORK? deadhead Programming 7 12-07-2003 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:02 AM.

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