looking for help with a dd loop check script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting looking for help with a dd loop check script
# 1  
Old 06-24-2008
looking for help with a dd loop check script

Hi

Can anyone please help with the following script I need - .ksh preferably?

I have external disks attached to a system that I have to label and then run the dd command on all external disk found.

I have kicked off the dd command as follows manually to see what its output is like first and what it throws back:

dd if=/dev/zero of=/dev/dsk/c0t0d0s2 bs=8192

and this doesn't seem to give an exit status or come back to the unix prompt? Should I kick these off as an external task (the ampersand - &)

But anyway...I need to kick off this dd command on all external hard disks found and then go into some kind of checking loop so I can check when these dd commands have finished and then carry on with the rest of my test.

As the dd command doesnt seem to give an exit status, I was thinking that I could run a ps -ef command:

ps -ef | awk '/dd/ && !/awk/ {print $2}'

and log the process id(s) for the dd commands and then when the dd commands have completed there will be NO process id.

How can I do this please within a loop?

thanks

angus
# 2  
Old 06-24-2008
No duplicate or cross-posting, please read our rules.

Continue here:

https://www.unix.com/unix-dummies-que...pt-please.html

Thread closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check two condition in while loop

Hi, I Have to check two condition in while loop every 2 minutes. while loop is accompanied with number of times it will check.Please help in putting the two condition in while loop as appropriate. z= input value, A=1 while do 1.check the file output,if the file output is N then keep on... (2 Replies)
Discussion started by: netdbaind
2 Replies

2. Shell Programming and Scripting

While Loop to Check for Integer

Hello All, In ksh I am trying to ensure that user inputs are integers otherwise redisplay prompt with the following code; a=0 b=0 c=0 read b?"Please enter a number: " read c?"Please enter another number: " while ] && ]; do read b?"Not a number. Please enter a number: " read c?"Not... (4 Replies)
Discussion started by: techieg
4 Replies

3. Shell Programming and Scripting

simple while loop script to check a connection

Hi, I am completely new to shell scripting. Basically I am wanting to create a simple while loop script to check if a network connection is available from 'netstat -a' and if its present then output a character to the serial port. I think i am nearly there.. but need some assistance.. this is... (9 Replies)
Discussion started by: zippyzip
9 Replies

4. Shell Programming and Scripting

Check condition inside the loop

Hi, I am in trouble. I can get inside my condition test inside a loop : I am in ksh (solaris) while read file do <commande to retrieve file> >> ${LOG_RETRIEVE_FILE.log} msg_err=$(cat ${LOG_RETRIEVE_FILE.log} | grep "error retrieve") if ; then <sendmail> exit 1 fi done I tried... (6 Replies)
Discussion started by: Aswex
6 Replies

5. Shell Programming and Scripting

WHILE LOOP CONDITION CHECK

Hello I want to compare values of two variables as CHECK condition in a while loop. eg: var1=0 var2=10 while do echo " $var1 " var1=`expr $var1 + 1` done However this is giving error.How to do it in a proper manner? Thanks. (3 Replies)
Discussion started by: dashing201
3 Replies

6. Shell Programming and Scripting

Loop check

Hi Gurus I have a recquirement where my loop should work if i have more than 4 listed files in a particular directory. Like the loop in while should continue checking if the directory has more than 4 files and should exit after there are 4 or more files ; if not more than 4 files it should... (5 Replies)
Discussion started by: r_t_1601
5 Replies

7. Shell Programming and Scripting

loop and check

Hi, We are doing a process manually and i am trying to automate it. This is the process. We have a set of files in the directory /temp/d1. the number of files are dynamic. For ex: if i have 5 files i want to compare the chatacters 45-58 of the last line of the first file with the same... (2 Replies)
Discussion started by: dnat
2 Replies

8. Shell Programming and Scripting

Check for statup process in loop?

I've written a script to check for Oracle's listener, eventman and pmon processes however there are several databases that startup which can take several minutes. I'd like to add code to my current script that greps for the process “startup” and whether its condition is true or false. If the... (1 Reply)
Discussion started by: dataciph3r
1 Replies

9. Shell Programming and Scripting

script to loop and check jumping seq.

Hi, Normally, I will manually to use "ll" command to list the following file from \FILE\CACHE\ directory and check the jump seq. Can I write a script to loop or/and check jump seq file (if jumped seq and show "missing seq no" message for me) -rw-rw----+ 1 user develop 14012 Sep 4... (1 Reply)
Discussion started by: happyv
1 Replies
Login or Register to Ask a Question