nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

[URGENT..HELP!] Please help me out.. ='(

This is a discussion on [URGENT..HELP!] Please help me out.. ='( within the Shell scripting forums, part of the Development/Scripting category; Hi all.. I'm new to this forum. I'm learning shell script by myself. So, when i face with problem, i ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-15-2007, 06:44 PM
Junior Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 3
Rep Power: 0
kzapth is on a distinguished road
Exclamation [URGENT..HELP!] Please help me out.. ='(

Hi all..

I'm new to this forum. I'm learning shell script by myself. So, when i face with problem, i have no1 to ask. I hope, you all will help me out. I've been hitting my head with the wall for several times to get the answer to the following problem. I REALLY AM desperate to get the answer . Here is the question that i found from a shell script tutorial website.
Write a Linux shell script that takes two arguments. These arguments can be files or directories. If two files are supplied, check if they have the same content and print a success or failure outcome.

If first argument is a file and the other is a directory, check if files exist in the directory and copy it if it is a newer version. If it doesn't exist, create a link in target directory.

If first argument is a directory and second argument is a file, user is prompted to choose whether to archive content of directory to file or extract archive from file to directory.

If BOTH arguments are directories, copy all files in first directory to second directory.

Your script should make sure that newer versions of files only are copied and report on each file when it is not the case. Make sure your script handle all error checking.


This is it.... Please help me to write a script for it. Thank you so much for your kind help. I need your help urgently.

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-16-2007, 06:59 PM
Junior Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 3
Rep Power: 0
kzapth is on a distinguished road
Unhappy [URGENT..HELP!] Guys, Plz dont ignore my post

Hi all...

Please don't ignore my post. I really am facing problem. Could anyone give any solution to my problem which is mentioned in previous post??? I really appreciate your kind help. Thanks in advance.
Reply With Quote
  #3 (permalink)  
Old 10-09-2007, 08:54 PM
Junior Member
User
 
Join Date: Oct 2007
My distro: Red hat
Posts: 13
Rep Power: 0
meenal is on a distinguished road
Default

you can use command if test . it checks whether the thing is file or directory , then forcomparing the cmd is diff.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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

Similar Threads

Thread Thread Starter Forum Replies Last Post
Very urgent --How to access the database informix ? jkmb All about FreeBSD/OpenBSD/NetBSD 0 01-22-2008 04:00 PM
[URGENT..HELP]Please don't ignore my post. =( kzapth Shell scripting 0 09-16-2007 07:41 PM
Rsync prblem pl. do favour, it's urgent kasimani Web servers 4 02-22-2007 05:12 PM
Rsync prblem pl. do favour, it's urgent kasimani Networking, Firewalls and Security 0 02-19-2007 11:27 AM


All times are GMT +5.5. The time now is 06:07 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36