Search Results

Search: Posts Made By: petel1
2,224
Posted By jim mcnamara
You are pushing the limits on the rules here. ...
You are pushing the limits on the rules here.

There are two ways,one using C and the wptmp[x] file, the other with who
using what pseudocoder gave you

t=0
while [ t -le 86400 ]; do
echo "...
2,224
Posted By pseudocoder
#!/bin/sh time=0; while true; do ...
#!/bin/sh

time=0;

while true; do

until [ $time = 86400 ]; do
date "+%T" >> present.txt
time=$(($time+10))
sleep 10
done

time=0
cp present.txt present.old
>present.txt
done
2,380
Posted By pseudocoder
-c count Stop after sending (and...
-c count
Stop after sending (and receiving) count ECHO_RESPONSE packets.
If this option is not specified, ping will operate until inter-
rupted. If this...
16,037
Posted By dr.house
if [ $( echo $pass | grep -o '[0-9]' | wc -l )...
if [ $( echo $pass | grep -o '[0-9]' | wc -l ) -ge 2 ]
3,151
Posted By dr.house
Based on your code: #!/bin/bash ...
Based on your code:


#!/bin/bash

USERS=$( cut -d: -f1 /etc/passwd )
for NAME in $USERS
do
PROCS=$( pgrep -cu $NAME )
echo "User: $NAME > Procs: $PROCS"
done

exit 0
#finis
5,810
Posted By Reboot
You can also use something like following : ...
You can also use something like following :


# more abc

#!/usr/bin/bash

if [ -z "$1" ]
then
echo "THIS SCRIPT REQUIRE AN ARGUMENT AS PROCESS_NAME....!!!!"
exit
else
PROC=`pgrep -l...
5,810
Posted By haaru
I havent tested it but try: ...
I havent tested it but try:



RES=$(ps -e | grep $1 | awk '{print $1}')

#This checks if the result of the command is not null
if [ -n "$RES"]; then
kill $RES
fi


You can...
1,822
Posted By pludi
Here's a pointer to the, aptly named, Homework &...
Here's a pointer to the, aptly named, Homework & Coursework Forum (https://www.unix.com/homework-coursework-questions/). Be sure to read the special rules...
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy