root> uname -r
5.10
root> cat /etc/release
Solaris 10 10/08 s10s_u6wos_07b SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 27 October 2008
Hello Everyone! I have a file called “cells” with 3 set of #'s, roughly 400+ lines. My current tool "movrcs" grabs the “cells” file, and creates one huge “mov_rcs” script which is a problem. I want the tool to grab 20 lines of the "cells" file at a time, and create separate script files for them, not one huge output script. Any assistance is greatly appreciated!!!!
omp root> cat cells
62 33 34
103 44 43
104 44 43
105 44 43
106 44 43
107 44 43
108 44 43
109 44 43
110 44 43
112 44 43
omp root> cat movrcs
while read cell prim alt
do
echo "/omp/bin/TICLI -1 move:rcs $cell,altap $alt" >> mov_rcs
echo "sleep 20" >> mov_rcs
echo "/omp/bin/TICLI -1 move:rcs $cell,priap $prim" >> mov_rcs
echo "sleep 40" >> mov_rcs
done < cells
ompeps root> cat mov_rcs
/omp/bin/TICLI -1 "move:rcs 62,altap" 34
sleep 60
/omp/bin/TICLI -1 "move:rcs 62,priap" 33
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,priap" 44
sleep 60
/omp/bin/TICLI -1 "move:rcs 104,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 104,priap" 44
sleep 60
…..output truncated, current tool creates one big file for all lines found in "cells" file.
As mentioned, I want tool to grab every 20 lines of "cells" file, and create a separate file. Script output sample below only grabbed 1 line from "cells" file to create individual scripts, which is similar to what im looking for:
ompeps root> cat mov_rcs1 <--notice 1 at end of file,
/omp/bin/TICLI -1 "move:rcs 62,altap" 34
sleep 60
/omp/bin/TICLI -1 "move:rcs 62,priap" 33
sleep 60
ompeps root> cat mov_rcs2 <--notice 2 at end of file,
/omp/bin/TICLI -1 "move:rcs 103,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,priap" 44
sleep 60
5.10
root> cat /etc/release
Solaris 10 10/08 s10s_u6wos_07b SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 27 October 2008
Hello Everyone! I have a file called “cells” with 3 set of #'s, roughly 400+ lines. My current tool "movrcs" grabs the “cells” file, and creates one huge “mov_rcs” script which is a problem. I want the tool to grab 20 lines of the "cells" file at a time, and create separate script files for them, not one huge output script. Any assistance is greatly appreciated!!!!
omp root> cat cells
62 33 34
103 44 43
104 44 43
105 44 43
106 44 43
107 44 43
108 44 43
109 44 43
110 44 43
112 44 43
omp root> cat movrcs
while read cell prim alt
do
echo "/omp/bin/TICLI -1 move:rcs $cell,altap $alt" >> mov_rcs
echo "sleep 20" >> mov_rcs
echo "/omp/bin/TICLI -1 move:rcs $cell,priap $prim" >> mov_rcs
echo "sleep 40" >> mov_rcs
done < cells
ompeps root> cat mov_rcs
/omp/bin/TICLI -1 "move:rcs 62,altap" 34
sleep 60
/omp/bin/TICLI -1 "move:rcs 62,priap" 33
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,priap" 44
sleep 60
/omp/bin/TICLI -1 "move:rcs 104,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 104,priap" 44
sleep 60
…..output truncated, current tool creates one big file for all lines found in "cells" file.
As mentioned, I want tool to grab every 20 lines of "cells" file, and create a separate file. Script output sample below only grabbed 1 line from "cells" file to create individual scripts, which is similar to what im looking for:
ompeps root> cat mov_rcs1 <--notice 1 at end of file,
/omp/bin/TICLI -1 "move:rcs 62,altap" 34
sleep 60
/omp/bin/TICLI -1 "move:rcs 62,priap" 33
sleep 60
ompeps root> cat mov_rcs2 <--notice 2 at end of file,
/omp/bin/TICLI -1 "move:rcs 103,altap" 43
sleep 60
/omp/bin/TICLI -1 "move:rcs 103,priap" 44
sleep 60