HUNTSVILLE, Texas (AP) _ Andrew Green slams the point of his 2-foot nightstick into the ground and orders about two dozen sweaty, huffing and puffing men and women to line up behind him.

``MOVE!'' he bellows.

Their initial efforts resemble something from the movie comedy ``Police Academy.'' The line might politely be called ragged.

But after a couple of hours of practice on a football field at Sam Houston State University, the recruits begin mastering the techniques of forming a line, a column, a wedge. With one hand on their nightsticks, they step forward as one, a quick thrust of their weapons matching each step.

Green is an instructor for the Texas Department of Criminal Justice and today is riot control training for the newest class of Texas prison guards.

They need to learn fast.

The next time they are called on to pull out their batons and form a line, their lives may be on the line.

After 4 1/2 weeks of training, the 103 rookie officers are within days of heading into an environment of danger and violence in the nation's second-largest prison system. They will join 27,300 security officers in a 151,000-inmate system that is operating about 2,000 guards short.

The shortage has been attributed to rapid expansion of the prison system, low pay, a booming economy that makes the prospect of spending the day guarding convicts less attractive, and the risks of dealing with inmates who seem to be getting meaner and more violent.

Prison officials are scrambling to keep penitentiaries staffed, recruiting at schools and over the Internet.

The guard deficit has been growing since a $2 billion prison expansion was completed in 1995, tripling the system's capacity. In 1995, the shortage was about 400, then became about 800 the following year.

At the same time, the attrition rate among guards has climbed from 11 percent in 1995 to 21 percent last year, outstripping the rate at which new ones are being hired.

The Texas prison population has climbed 19 percent in the past five years. And violence toward officers has skyrocketed, up 129 percent in the same period to 1,649 assaults in 1999.

Corrections officials say stiffer parole requirements and longer minimum sentences are hardening prisoners: As inmates have lost incentives to behave, they have become more dangerous.

``Every day we go to work we don't know if we'll walk out or not,'' says Dave Giblin, 47, an officer at the Skyview/Hodge Unit in Rusk in East Texas.

In December, a guard at Beeville became the first Texas corrections officer killed in 17 years. In January, a guard at the Byrd Unit in Huntsville was stabbed in the belly with a pencil. Last month, two death row inmates armed with pieces of metal took a female officer hostage and held her for 13 hours before surrendering.

Everyone, including prison officials and Gov. George W. Bush, agree low pay is a factor. Texas prison guards salaries' top out at $26,724 after 18 months of service, compared with the national average of $34,404. Texas guards are the 46th-lowest paid in the nation.

``The problem is that the economy in Texas is so good right now and our salary is not competitive with the marketplace,'' says Wayne Scott, the prison system's executive director. ``It takes six applications to fill one position.''

Joseph Domingues, warden at a prison in Dalhart in the Texas Panhandle, says: ``When you have a town with a population of 6,000, and an unemployment rate of 1 percent, it's very competitive.''

Around the country, many states have had difficulty attracting applicants.

``It's a persistent problem,'' says James Turbin, a spokesman for the Lanham, Md.-based American Correctional Association. ``Staffing has not caught up with growth and it's a profession that traditionally has had a high turnover rate. The Texas issue is magnified by the size of the system.''

In the Northeast, a key issue is money _ guards want pay equal to that of law enforcement officers, Turbin says. In other states, the problem is a limited labor pool in the remote areas where prisons often are located.

``The jobs aren't where the people are,'' he says. ``And this is not the type of job that will draw somebody from an urban area. It becomes a recruitment problem.''

In Texas, the heads of both legislative committees that deal with prisons agree about the need for higher pay.

But ``it came down to priorities this last session,'' says Republican Rep. Patrick Haggerty, noting the emphasis was on teachers, who received $3,000 raises. ``You can't improve everybody's lot in one fell swoop.''

In any case, Democrat Ken Armbrister, chairman of the Senate Criminal Justice Committee, notes that Texas guards _ unlike other state employees _ can retire after 20 years and start drawing benefits at 50. They can also get free meals, laundry, haircuts and even housing at the prisons.

That hasn't stopped irate officers from rallying on the Capitol steps or booing lawmakers in their home districts.

``Do you think $27,000 is enough to lay your life on the line every single day?'' asks Bob Trout, 56, who retired after 16 years.

It's enough for Patricia Bookman, who has several relatives already working in the prison system and was looking forward to graduation from the training academy in Hunstville and her assignment to a prison.

``They prepare you to be frightened and to have fear,'' she says. She says she believes she's prepared to work in ``a challenging environment.''