Sponsored Content
Full Discussion: How to ask...???
Top Forums UNIX for Advanced & Expert Users How to ask...??? Post 7561 by nemex on Thursday 27th of September 2001 06:37:27 PM
Old 09-27-2001
Thanks allot this realy helped, you have no idea.

FINAL SCRIPT if you are interested

#!/bin/sh
# Simple example to read in a line, then echo it out
# If you're using Linux, you'll need to use "echo -e"
# instead of "echo"--> UNIX.

echo "Please Enter The Program Name: \c"

# The \c tells echo not to add a new line

read PROG

# That's where it takes your input and stores it into the
# variable "PROG" - you can name this whatever you want

echo "\nThe \$PROG variable was: $PROG"

# The "\n" forces echo to insert a new line at that spot
#Checking processes
ps -ef |grep "$PROG" > f1
cat f1 |cut -c 1-8 > a.1
cat f1 |cut -c10-14 > b.1
paste a.1 b.1 > B
cat f1 |cut -c49-72 > c.1
paste B c.1 > final
echo "STARTING TO CHECK"
echo "3"
sleep 1
echo "2"
sleep 1
echo "1"
cat final |more
rm f1
rm a.1
rm b.1
rm c.1
rm B
rm final

Thanks.
Marcus.
 
script(1)						      General Commands Manual							 script(1)

NAME
script - Makes a transcript of terminal session SYNOPSIS
script [-a] [file] The script command makes a transcript of everything printed on your terminal. OPTIONS
Appends the transcript to file rather than writing it to file. OPERANDS
The name of an output file that will contain the transcript of the session. If this parameter is omitted, the file typescript is written. DESCRIPTION
The transcript is written to file, or appended to file if the -a option is given. If no file name is given, the transcript is saved in the file typescript. The script ends when the forked shell exits. This program is useful when you are using a CRT and want a hard-copy record of the dialog (for example, a technical writer might create an example of a working session this way). If you specify the -a option and the file does not exist, it is created. If you do not specify the -a option and the file exists, it is replaced. RESTRICTIONS
The script command requires a streams based terminal. In single user mode, streams may not be enabled. Under these circumstances, script will exit with no action. If you are the superuser and need to run this command in single user mode, use the following special instruc- tions. Enabling Streams If it is necessary to enable a streams environment in the single user mode, enter the command /sbin/init.d/streams. This command is avail- able to the superuser only. SEE ALSO
Commands: autopush(8), cat(1), echo(1), strsetup(8), tee(1) System Administration script(1)
All times are GMT -4. The time now is 09:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy