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)
Check Out this Related Man Page
script(1) User Commands script(1)NAME
script - make record of a terminal session
SYNOPSIS
script [-a] [filename]
DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the
record is saved in the file typescript. See WARNINGS.
The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends
when the forked shell exits or when Control-d is typed.
OPTIONS
The following option is supported:
-a Appends the session record to filename, rather than overwriting it.
NOTES
script places everything that appears on the screen in filename, including prompts.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a
privileged user, that is, root. Be sure that typescript is not a link before running script.
SunOS 5.11 30 Jan 2004 script(1)
Hello there.
I'm trying do make a script capable of verifying if a given script is running at the moment in the environment, and if does, forbid it to execute.
So, I've coded this so far:
#!/bin/ksh
set CUR_SHELL="/bin/ksh"
set V1="VAR1"
set V2="VAR2"
ps -e -o args | grep "$CUR_SHELL... (16 Replies)
I've a list file, which has some file names.
ex: list file "list_file" will have
data_file1.txt
data_file2.txt
data_file3.txt
:
:
data_filen.txt
Above files will have the below layout:
Header1
Header2
*TM*
Data record 1
Datarecord 2
Datarecord n
*TM* (19 Replies)
Dear all,
i m unable to give array decalartion in solaris Operating system shell script
and script was so.sh
declare -a bull
for i in 1 2 3 4 5 6 7 8 9
do
bull=$i
echo "${bull}"
done
it is throwing an error called
so.sh: declare: not found
so.sh: bull=1: not... (20 Replies)
hi all....
I'm a newbie to Shell scripting and am trying to make a simple script that can unpack a variety of .tgz , .zip, .tar or .tar.gz archives to the a current directory
i want the script to create a folder equivalent to the base name of the archive and then move the archive to a... (18 Replies)
Hi all,
I'm user of Solaris, and i want to create just small script which should be running each 15 minutes, starting from 23h30 till 3h30, inside this script only one commande: df -k.
So please, is there anyone who can help to have or to create such script ???
Thx. (15 Replies)
Hello All I am a chemist and really dont know too much about programming but here goes.
Essentially I need to create a script that I can run which will do the following.
Create a file where the first four lines are a set of commands that are the same for all the files. E.g
ln1: comment... (40 Replies)
I have a script which will mask the 9th and 15th column in a record starting with BPR.
The record looks like below before my script
BPR*C*160860.04*C*ACH*CTX*01*072000326*DA*1548843*3006968523**01*071000013*DA*5529085*100323*VEN
The record will be masked after my script parses this... (19 Replies)
Good morning everyone,
i am looking to know how to save the output of a command and reuse it again within a script
i already tired this one but it didn't work
TEMPDIR=/dir1/dir2
My_command> $TEMPDIR/$TEMPFILE
rm $TEMPDIR/$TEMPFILE*
it keeps saying "cannot write to a... (15 Replies)
Hi,
I'm trying to do input validation for a file. If the user fails to enter a file name, the script should prompt for the file name or exit. I'm using this script to integrate with a bigger script which does ftp of the files which are "read".
#!/bin/ksh
echo "enter a file name"
if
then... (16 Replies)
hii all,
i am writing a shell script to remove comments from a .c/.cpp file.
i have written script as
the above script file deletes line between /* and */ also lines starting with //.
but the problems are :
1) i dont want to delete the content between /** and */.
2)sed -i... (16 Replies)
Hi
script> isumid 98765432
if i give above command in cmd prompt it is running the same thing if i give inside the shell script it is not working
below is the code
#!/bin/bash
isumid 98765432
please give me a solution (16 Replies)
I am inexperienced with scripting and it continues to baffles me speechless
I wrote a script so that it counts the number of subset of files (with different prefix) in all subdirectories under the current directory so that
find ./ -type d -maxdepth 1 -mindepth 1 > list_of_dir.txtfind all... (23 Replies)
I have a script that I need to run on one file at a time. Unfortunately using for i in F* or cat F* is not possible. When I run the script using that, it jumbles the files and they are out of order. Here is the script:
gawk '{count++; keyword = $1}
END {
for (k in count)
{if (count == 2)... (18 Replies)
This is my first experience writing unix script. I've created the following script. It does what I want it to do, but I need it to be a lot faster. Is there any way to speed it up?
cat 'Tax_Provision_Sample.dat' | sort | while read p; do fn=`echo $p|cut -d~ -f2,4,3,8,9`; echo $p >> "$fn.txt";... (20 Replies)