05-22-2007
stop Prstat using shell script
How to stop the Prstat using shell script ?
because after i run the below script the thing seems to be always in loop and cannot get out till i ctrl + c, is there anything that i can add in the script to make it terminate ?
<code>
#!/bin/sh
prstat -Tc -u testing > testing.txt
</code>
please help a noob ....
Last edited by filthymonk; 05-22-2007 at 05:31 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following:
mike=1
if ; then
STOP THE SCRIPT
fi (3 Replies)
Discussion started by: msb65
3 Replies
2. Shell Programming and Scripting
Hello,
I am ftping the file from one unix box to another box. This script works fine. Only problem here is, it is asking the password when ftp the file. How can i stop that. I am providing the password inside the shell script. But it is not accepting this. I need to put this script in crontab.... (5 Replies)
Discussion started by: govindts
5 Replies
3. UNIX for Dummies Questions & Answers
Script_A.sh has
echo "In am in script A"
ksh ## K-shell is invoked.
Script B.sh ## which I am writing...
./script_A.sh
echo "I am in script B"
return 0
When I run:
$> Script_B.sh
$> I am in script A
$>
Basically, on calling Script_A.sh from within Script_B.sh I have the issue of... (2 Replies)
Discussion started by: baivab
2 Replies
4. Shell Programming and Scripting
Hi All,
I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task.
1. User will input the option which server they wish to stop.
2. Will clear cache files from specific location.
3. ... (1 Reply)
Discussion started by: venga
1 Replies
5. Shell Programming and Scripting
Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed:
#/bin/sh
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
... (0 Replies)
Discussion started by: rich@ardz
0 Replies
6. AIX
I have a strange problem.
I have the following in a cron to find files older than a day.
find /dir1/dir2/ ! -name . -prune -name "s*.txt" -type f -mtime +1 -exec echo {} \; | wc -w
It was working fine for the last few days now it suddenly stopped working. I can clearly see files in the... (5 Replies)
Discussion started by: bbbngowc
5 Replies
7. Shell Programming and Scripting
Need shell script to:
1/keep polling a directory "receive_dir" irrespective of having files or no files in it.
2/move the files over to another directory "send_dir".
3/the script should only stop polling upon a file "stopfile" get moved to "receive_dir". Thanks !!
My script:
until
do... (0 Replies)
Discussion started by: iaav
0 Replies
8. Shell Programming and Scripting
Hi folks,
I am running a shell script it asks for username and password to stop some service, I need to write some script that it will read username and password from my shell script and then sucessfully stop services without prompting username/password query. (13 Replies)
Discussion started by: learnbash
13 Replies
9. Shell Programming and Scripting
Hi,
I need to create a shell script for automated server patching, with the following scenario:
I have two Linux servers Primary and secondary.
Server patching should start on Primary 1st and then secondary.
1st check both servers are up and running.
Then stop primary and patching will... (1 Reply)
Discussion started by: rcroyal88
1 Replies
10. UNIX for Beginners Questions & Answers
I am writing a bash shell script for GarazLab's "WP EMAIL CRAWLER - AUTO SCRAPER & REAL TIME EXTRACTOR". it contains some commands. I want to stop the shell execution as soon as it encounters an error. how to do it? (8 Replies)
Discussion started by: tahsin352
8 Replies
LEARN ABOUT FREEBSD
dh_systemd_start
DH_SYSTEMD_START(1) Debhelper DH_SYSTEMD_START(1)
NAME
dh_systemd_start - start/stop/restart systemd unit files
SYNOPSIS
dh_systemd_start [debhelperoptions] [--restart-after-upgrade] [--no-stop-on-upgrade] [unitfile...]
DESCRIPTION
dh_systemd_start is a debhelper program that is responsible for starting/stopping or restarting systemd unit files in case no corresponding
sysv init script is available.
As with dh_installinit, the unit file is stopped before upgrades and started afterwards (unless --restart-after-upgrade is specified, in
which case it will only be restarted after the upgrade). This logic is not used when there is a corresponding SysV init script because
invoke-rc.d performs the stop/start/restart in that case.
OPTIONS
--restart-after-upgrade
Do not stop the unit file until after the package upgrade has been completed. This is the default behaviour in compat 10.
In earlier compat levels the default was to stop the unit file in the prerm, and start it again in the postinst.
This can be useful for daemons that should not have a possibly long downtime during upgrade. But you should make sure that the daemon
will not get confused by the package being upgraded while it's running before using this option.
--no-restart-after-upgrade
Undo a previous --restart-after-upgrade (or the default of compat 10). If no other options are given, this will cause the service to
be stopped in the prerm script and started again in the postinst script.
-r, --no-stop-on-upgrade, --no-restart-on-upgrade
Do not stop service on upgrade.
--no-start
Do not start the unit file after upgrades and after initial installation (the latter is only relevant for services without a
corresponding init script).
NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command (with the same arguments).
Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts.
Note that dh_systemd_start should be run after dh_installinit so that it can detect corresponding SysV init scripts. The default sequence
in dh does the right thing, this note is only relevant when you are calling dh_systemd_start manually.
SEE ALSO
debhelper(7)
AUTHORS
pkg-systemd-maintainers@lists.alioth.debian.org
11.1.6ubuntu2 2018-05-10 DH_SYSTEMD_START(1)