Added support for reading from stdin.
This commit is contained in:
		
							parent
							
								
									3f1b96e1bb
								
							
						
					
					
						commit
						8b7944dad7
					
				
							
								
								
									
										16
									
								
								ppss
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								ppss
									
									
									
									
									
								
							@ -25,7 +25,7 @@ trap 'kill_process' SIGINT
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Setting some vars. 
 | 
					# Setting some vars. 
 | 
				
			||||||
SCRIPT_NAME="Distributed Parallel Processing Shell Script"
 | 
					SCRIPT_NAME="Distributed Parallel Processing Shell Script"
 | 
				
			||||||
SCRIPT_VERSION="2.61"
 | 
					SCRIPT_VERSION="2.62"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The first argument to this script can be a mode.
 | 
					# The first argument to this script can be a mode.
 | 
				
			||||||
MODES="node start config stop pause continue deploy status erase kill ec2"
 | 
					MODES="node start config stop pause continue deploy status erase kill ec2"
 | 
				
			||||||
@ -1442,7 +1442,7 @@ get_all_items () {
 | 
				
			|||||||
        then
 | 
					        then
 | 
				
			||||||
            log DEBUG "Running as slave, input file has been pushed (hopefully)."
 | 
					            log DEBUG "Running as slave, input file has been pushed (hopefully)."
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        if [ ! -e "$INPUT_FILE" ]
 | 
					        if [ ! -e "$INPUT_FILE" ] && [ ! "$INPUT_FILE" == "-" ]
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
            log ERROR "Input file $INPUT_FILE does not exist."
 | 
					            log ERROR "Input file $INPUT_FILE does not exist."
 | 
				
			||||||
            set_status "ERROR"
 | 
					            set_status "ERROR"
 | 
				
			||||||
@ -1450,6 +1450,9 @@ get_all_items () {
 | 
				
			|||||||
            exit 1
 | 
					            exit 1
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					        if [ ! "$INPUT_FILE" == "-" ]
 | 
				
			||||||
 | 
					        then
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
            exec 10<"$INPUT_FILE"
 | 
					            exec 10<"$INPUT_FILE"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            while read LINE <&10
 | 
					            while read LINE <&10
 | 
				
			||||||
@ -1459,6 +1462,15 @@ get_all_items () {
 | 
				
			|||||||
            done
 | 
					            done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            exec 10>&-
 | 
					            exec 10>&-
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            log DEBUG "Reading from stdin.."
 | 
				
			||||||
 | 
					            while read LINE
 | 
				
			||||||
 | 
					            do
 | 
				
			||||||
 | 
					                ARRAY[$count]=$LINE
 | 
				
			||||||
 | 
					                ((count++))
 | 
				
			||||||
 | 
					            done
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DEBUG="$1"
 | 
					DEBUG="$1"
 | 
				
			||||||
VERSION="2.61"
 | 
					VERSION="2.62"
 | 
				
			||||||
TMP_DIR="ppss"
 | 
					TMP_DIR="ppss"
 | 
				
			||||||
PPSS=./ppss
 | 
					PPSS=./ppss
 | 
				
			||||||
PPSS_DIR=ppss_dir
 | 
					PPSS_DIR=ppss_dir
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user