Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-Apr-2008, 18:38
Slipstream
Guest
 
Posts: n/a
Default

Hi,

does anyone know how to test the negative of this expression?

Code:
if test -d /mnt/folder; then 
** mkdir /mnt/folder
fi
As you can probably see, I want to create /folder if it doesn't already exist. It should look like this:

Code:
if test -d ![/mnt/folder]; then 
** mkdir /mnt/folder
fi
But it doesn't work. Can anyone please tell me how it's done?
  #2 (permalink)  
Old 07-Apr-2008, 18:44
McQueen
Guest
 
Posts: n/a
Default

Did you try: if test ! -d <commands> ??
  #3 (permalink)  
Old 07-Apr-2008, 20:51
Slipstream
Guest
 
Posts: n/a
Default

Quote:
Did you try: if test ! -d <commands> ??
[/b]
That was it. I've been trying this for a few hours now. Not sure how I missed that combination. Thanks!
 

Bookmarks

Thread Tools
Display Modes

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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2