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
check the directory exist ust Shell Programming and Scripting 7 09-22-2008 09:49 PM
Need Script to check file exist and compare rbknisely UNIX for Dummies Questions & Answers 1 01-16-2008 01:08 AM
check in unix shell script so that no one is able to run the script manually adi_bang76 Shell Programming and Scripting 1 11-16-2006 10:43 AM
Have a shell script check for a file to exist before processing another file heprox Shell Programming and Scripting 3 11-14-2006 03:26 AM
how to check if the file exist or not? gusla UNIX for Dummies Questions & Answers 3 03-27-2002 10:56 PM

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

Join Date: Jan 2008
Posts: 1
How to check path exist or not in UNIX shell script

UNIX Shell Script
I'm in /home/suneel dirctory
in that directory need to check for a path for example com/src/resources
If Path exists need to copy the files from one directory
If path not exist need to create the folders and copy the files
UNIX shell script help required
  #2 (permalink)  
Old 01-22-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,556
man test. Always check the man page first
  #3 (permalink)  
Old 01-22-2008
thana thana is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 55
UNIX Shell Script
I'm in /home/suneel dirctory
in that directory need to check for a path for example com/src/resources
If Path exists need to copy the files from one directory
If path not exist need to create the folders and copy the files
UNIX shell script help required

[code]
#!/bin/bash
dir="dir path"
file="filename"
if [ -f $dir/$file ]
then
command
else
command
fi

[code]
  #4 (permalink)  
Old 01-22-2008
uvrakesh uvrakesh is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 78
mkdir -p com/src/resources


Best Regards,
Rakesh UV
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 12:35 PM.


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