The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Quick question about finding a large file raidkridley UNIX for Dummies Questions & Answers 6 10-19-2008 04:39 PM
quick question keith.m AIX 5 12-21-2006 09:27 AM
quick question pkolishetty UNIX for Dummies Questions & Answers 2 09-02-2006 11:56 AM
quick question penfold Shell Programming and Scripting 2 03-18-2005 06:15 AM
Quick Question Tracy Hunt UNIX for Dummies Questions & Answers 3 02-20-2001 04:20 PM

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

Join Date: Oct 2008
Posts: 48
Quick if file exist question...

What does the "!" do in the second statement? Is kinda strange but sometimes one or the other works.

rsakey="~/.ssh/id_rsa.pub"

if [ -f $rsakey ];then
if [! -f $rsakey ];then
  #2 (permalink)  
Old 11-30-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by elbombillo View Post
What does the "!" do in the second statement? Is kinda strange but sometimes one or the other works.

rsakey="~/.ssh/id_rsa.pub"

if [ -f $rsakey ];then
if [! -f $rsakey ];then
-f checks for file existence. The ! represents the NOT operator. Therefore you can read 'if [ ! -f $rsakey ] ; then' as 'if rsakey does not exist'
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 08:50 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