|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
New to scripting, need help on error "scalar assignment"
Hi,
I am very new to scripting, if possible I need some help: Here is an edited script that I would like to retreive the counts of how many instances of a program are running. The script will be collecting data t output to a screen, and I would like to insert the counts in the output, but I receive the error: "Can't modify constant item in scalar assignment at ./rk7 line 11, near "`ps -ef | grep -i uvspool | grep -v grep | wc -l`;" " Here is the partial script: while ($repeat) { COUNT=`ps -ef | grep -i uvspool | grep -v grep | wc -l`; ### code will go here: if (! $pslocate) { print " WARNING!!! *** $process *** NOT RUNNING\n"; } else { @pslocate = split( /\s+/, $pslocate ); print " Running by $pslocate[1] \t and PID is $pslocate[2] \t $COUNT ---> $process - OK\n"; } } print "\n TEST : \n"; exit unless $loop; sleep $repeat; Thank You |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > New to scripting, need help on error "scalar assignment" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|