help on this command, creating ..

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions help on this command, creating ..
# 8  
Old 03-26-2010
I want to see the algorithm of how you understand the entered arguments;
Quote:
The names of directories to copy will always be specified for the home user.
I may be wrong but I understand as:
means whatever argument is entered, you have to check if it exits first in $HOME
then check if its a directory..
Quote:
Within this directory (the copy of the instant),
I dont get.... (??)
Quote:
each directory passed as argument of the script should be copied, including sub-directories and files, preserving dates and times of access and modification of them.
look around on this forum we all have our way to do things (may not be cp... for instance what happens if the file, or directory (subdirectory etc...) is a link? )

You have now plenty of information to work on!

Good luck
# 9  
Old 03-26-2010
ok thanks , i will try
# 10  
Old 03-26-2010
I hope so!

We will be here to help you, but the work - you are to do!
What Im pointing at is an explicit algorithm is readable for anyone here (no language dependant). A bad program takes some time even for us to understand what is going on especially if the writer did no documenting in it...
Here we can show before the code part, if its good or wrong or if you forgotten something...

Will we see the beginning in an hour time?...
# 11  
Old 03-26-2010
DIR=/dir/$(date +%y%m) */ DIR, folder or directory create than get the following directory, $dir and get the date,,, i m not sure if thats possible

[ -d "$DIR" ] || mkdir "$DIR" if the directory not exist, create one, the name will be backup... how i put at directory home...?? (-d true if file exist and is a directory)

so now i need to know if the directory exist, i m sure...

if exist i can copy the dir( $ dir) , in first to a temporary folder??

---------- Post updated at 02:59 PM ---------- Previous update was at 02:55 PM ----------

"(may not be cp... for instance what happens if the file, or directory (subdirectory etc...) is a link? )",, if i use the echo dir.. can be..sorry for my stupid questions... but if i m learn i need ask... :$

---------- Post updated at 03:23 PM ---------- Previous update was at 02:59 PM ----------

#!/bin/bash
DIR=/dir/$(date +%y%m) */ DIR, folder or directory create than get the following directory, $dir and get the date,,, i m not sure if thats possible

[ -d "$backup" ] || mkdir "$backup" if the directory not exist, create one, the name will be backup...

for (echo pwd)
do
cp /usr/home/backup

that is my best.. how i can put date and time... i dont idea how..
# 12  
Old 03-26-2010
The best/hard way to learn is to test and see what is going on...
1) create a dir, add a few things, create a subdir, do the same..., in dir create a symbolic link to subdir calling it mylinkdir.
2) cp how you can all what you just did in mybckdir

3) analyse the result:
do I have all?
And the subdir?
what about the perms and ownership
what about the time stamps of copied stuff?
what can you say about the link?

I see you are still trying to code without a beginning of algorithm/procedure... so dont expect much help from you peers
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Creating file and passing argument to a command

Hi All, I am having command to run which will take argument as input file. Right now we are creating the input file by cat and executing the command ftptransfer -i input file cat >input file file1 file2 cntrl +d Is there a way I can do that in a single command like ... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Shell Programming and Scripting

Using -text command and creating multiple files

Currently using the below script to being all compressed files .gz files from source folder and appending to the target txt file uncompressed. Teh target txt file is getting too large in size, right now the size of the target txt file is almost 350GB hadoop fs -text... (3 Replies)
Discussion started by: cplusplus1
3 Replies

3. Shell Programming and Scripting

creating own command interpreter like bash...??

Hello senior members, I am a fairly newbie here. I just want to ask one question that how can once create one's own command interpreter/ shell like bash in unix/linux. I need to execute basic commands like pipes and i/o. Any help in this matter ?? (3 Replies)
Discussion started by: duma188
3 Replies

4. UNIX for Dummies Questions & Answers

Creating File using the CAT Command

Hello , I am newbie to UNIX platform . I have read that there are two ways of creating files that is using 1.) Cat 2.) touch . With Cat Command i am unable to create a File , i is saying No file or Directory exists I logged in with root as user . please help (7 Replies)
Discussion started by: Ravi Pavanv
7 Replies

5. UNIX for Dummies Questions & Answers

creating a command and sorting???

How do you write a command line that displays the number of files in the working directory with names that end with the letter S? Thanks ---------- Post updated at 09:34 PM ---------- Previous update was at 09:33 PM ---------- for unix sorry (1 Reply)
Discussion started by: jorogon0099
1 Replies

6. Shell Programming and Scripting

Creating a command on a BASH shell

Hi all. Suppose I have the following function in an executable file named "HOLA": ------------------------ function hola { echo "Hola ${@}."; } ------------------------ In addition, suppose that I want to execute the file so I can input my name next to ./HOLA. I mean,... (4 Replies)
Discussion started by: hresquivelo
4 Replies

7. Solaris

Creating a Man page for a command

Hi, I would like to develop a man page as the one we usually get when we execute man <command name>. This man page will be for a samll utility that i have written. If this is not possible then what are the available possibilites for creating such help. thanks in advance. (2 Replies)
Discussion started by: raghu.amilineni
2 Replies

8. UNIX for Dummies Questions & Answers

Creating a file that contains output from a command, and then displays itself

hey, I'm trying to create the command that will create a file named user.txt that contains the output of the command cut -d: -f1,5 /etc/passwd, and displays itself afterwards. I don't know how to bridge cat > user.txt with cut -d: -f1,5 /etc/passwd, or how display it afterwards. Any help would... (2 Replies)
Discussion started by: raidkridley
2 Replies

9. OS X (Apple)

creating a new profile from command line

Does any1 know how to preform such an operation on a mac? any help appreciated (2 Replies)
Discussion started by: cleansing_flame
2 Replies

10. Shell Programming and Scripting

creating file of 1MB using shell command?

Hi everybody in the forum, I want to create an empty file of say some 1MB ,i mean at the command line itself.How is this possible??????EEK! (4 Replies)
Discussion started by: vijaya2006
4 Replies
Login or Register to Ask a Question