Script Help (ls) ??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script Help (ls) ??
# 1  
Old 10-28-2002
...

Last edited by april04; 10-29-2002 at 12:08 PM..
# 2  
Old 10-29-2002
I am leary this may be home work simply because of the word "apple", so I will only give you a suggestion. Look at the -exec option of find. You can use this with a cp command to copy the file to /tmp.
# 3  
Old 10-29-2002
...

Last edited by april04; 10-29-2002 at 12:09 PM..
# 4  
Old 10-29-2002
The "homework" thing is arising because the questions that you posting look very much like problem that an instructor would assign to a student. If a student cannot complete such an assignment, the student must seek more help from the instructor. If we simply do the assignment for the student we are sabotaging the class.

I will take your word that you are not enrolled in a formal unix class.

From your post it appears that you have the root password and that you are using to root account while you experiment with commands that you don't understand. This is a very big mistake. The root account has the power to do anything. Sooner or later you are going to make an error that will damage your system. And you don't have the knowledge to fix it. You need to experiment as a non-root user. Become root only when you absolutely must, do what you must, and then get out. Don't stay logged on as root.

As for your question, I don't like the -exec option very much because it is not very efficient. I would use:
find / -name apple -print | xargs ls -l > /tmp/namefile

And while you're experimenting, maybe you should just do "find /home/april" or something rather than "find /". A find from / like that can take a long time. You can get the syntax right by just experimenting with your own home directory. This is also somewhat safer.

Finally, you really do need to improve your skills at searching both at this site and at google. There is a lot information available on the web about the questions that you are asking. And it's not fair for you to expect us to type in another copy for each question that you have. Also you probably have the man pages installed on your system. If so, you can type stuff like "man find" and get some help.
# 5  
Old 10-29-2002
MySQL

Thank You All for Helping...Smilie

Thank You Perderabo

Last edited by april04; 10-29-2002 at 02:09 PM..
# 6  
Old 10-29-2002
don't go, stay and post awhile...

April,

You don't have to delete your postings just because they seemed like homework.

Please leave them intact. They will provide good examples for others to see that you are doing "personal advancement" and not "homework for school".

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

5. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
Login or Register to Ask a Question