madhuneal / ppss

Automatically exported from code.google.com/p/ppss
0 stars 0 forks source link

Bug or feature - $ITEM or "$ITEM" #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
[psarkar@teentaal ppssTrial]$ cat largeLoop.sh 
#!/bin/bash

N=0
PN=$BASHPID
while (( $N < 1000 )); do
   N=$(( $N + 1 ));
   echo ${PN}_${N};
   sleep 1;
done

[psarkar@teentaal ppssTrial]$ head -5 joblistNumbered.txt 
/tmp/ppssTrial/largeLoop.sh 1
/tmp/ppssTrial/largeLoop.sh 2
/tmp/ppssTrial/largeLoop.sh 3
/tmp/ppssTrial/largeLoop.sh 4
/tmp/ppssTrial/largeLoop.sh 5
[psarkar@teentaal ppssTrial]$ wc -l joblistNumbered.txt 
170 joblistNumbered.txt
[psarkar@teentaal ppssTrial]$ 

What is the expected output? What do you see instead?

I expect
ppss.sh -f aaa -c 'sh '
and
ppss.sh -f aaa -c 'sh $ITEM'
to behave the same. instead former behaves like
ppss.sh -f aaa -c 'sh "$ITEM"'
See below:

[psarkar@teentaal ppssTrial]$ ppss.sh -f joblistNumbered.txt -c 'sh '
Dec 09 10:27:38:  =========================================================
Dec 09 10:27:38:                         |P|P|S|S|                         
Dec 09 10:27:38:  Distributed Parallel Processing Shell Script version 2.41
Dec 09 10:27:38:  =========================================================
Dec 09 10:27:38:  Hostname:     teentaal
Dec 09 10:27:38:  ---------------------------------------------------------
Dec 09 10:27:38:  CPU: Intel(R) Xeon(TM) CPU 3.20GHz
Dec 09 10:27:38:  Found 8 logic processors.
Dec 09 10:27:38:  Starting 8 parallel workers.
Dec 09 10:27:38:  ---------------------------------------------------------
Dec 09 10:27:45:  Currently 100 percent complete. Processed 170 of 170 items.
Dec 09 10:27:46:  1 job is remaining.       
Dec 09 10:27:46:  Finished. Consult ./ppss/job_log for job output.
[psarkar@teentaal ppssTrial]$ more ppss/job_log/tmpppssTriallargeLoop.sh\ 1
===== PPSS Item Log File =====
Host:       teentaal
Process:12686
Item:       /tmp/ppssTrial/largeLoop.sh 1
Start date: Dec 09 10:27:39

sh: /tmp/ppssTrial/largeLoop.sh 1: No such file or directory

Status:     FAILURE
Elapsed time (h:m:s): 0:0:0

[psarkar@teentaal ppssTrial]$ \rm -r ppss/
[psarkar@teentaal ppssTrial]$ ppss.sh -f joblistNumbered.txt -c 'sh $ITEM'
Dec 09 10:28:55:  =========================================================
Dec 09 10:28:55:                         |P|P|S|S|                         
Dec 09 10:28:55:  Distributed Parallel Processing Shell Script version 2.41
Dec 09 10:28:55:  =========================================================
Dec 09 10:28:55:  Hostname:     teentaal
Dec 09 10:28:55:  ---------------------------------------------------------
Dec 09 10:28:55:  CPU: Intel(R) Xeon(TM) CPU 3.20GHz
Dec 09 10:28:55:  Found 8 logic processors.
Dec 09 10:28:55:  Starting 8 parallel workers.
Dec 09 10:28:55:  ---------------------------------------------------------
Dec 09 10:28:55:  Currently 4 percent complete. Processed 8 of 170 items.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by sarkarpr...@gmail.com on 9 Dec 2009 at 6:32

GoogleCodeExporter commented 9 years ago
I think I understand, It must be better documented that if you use the $ITEM 
placeholder, you need to use " ".

Original comment by Louwrentius on 13 Dec 2009 at 8:48

GoogleCodeExporter commented 9 years ago
I could not get your script to work with 'sh ', although 'bash ' worked 
withouth a
hitch. You need to 'escape' the $ITEM substitute if it contains spaces or it 
wil not
be parsed properly. 

If I do not understand this issue properly, please let me know.

Original comment by Louwrentius on 16 Dec 2009 at 2:10

GoogleCodeExporter commented 9 years ago
I now see the issue. In order to run this command properly, you must use $ITEM
instead of "$ITEM" as how I documented it. This depends on the situation. I 
cannot
fix this, I will update the documentation.

Original comment by Louwrentius on 16 Dec 2009 at 3:34

GoogleCodeExporter commented 9 years ago

Original comment by Louwrentius on 16 Dec 2009 at 7:08