Solved

Script Utility Fails

Posted on 2004-10-14
4
290 Views
Last Modified: 2013-12-27
Hello,

I am trying to run the 'script' utility in SunOS 5.8 to make a capture of a sequence of commands that I am performing.

I type:

> script test.txt
Script started, file is test.txt
No such file or directory
Script done, file is test.txt

And it just immediately quits the script program.  I checked the man page for the script utility, and it says that it forks and creates a sub-shell based on the value of $SHELL.  So, I checked did an "echo $SHELL" and it came out blank.  Strange.  So I run a "set SHELL=/usr/bin/tcsh".  But I still get the same results when I run the script utility.

By the way, I tried both /usr/bin/script and /usr/ucb/script, and both yield the same results.

Please help! =)
0
Comment
Question by:jshantz4
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:Otetelisanu
ID: 12306914
0
 
LVL 4

Accepted Solution

by:
Otetelisanu earned 500 total points
ID: 12306967
script test.txt /tmp/test.log

make ls -l

after cat /tmp/test.log

0
 

Author Comment

by:jshantz4
ID: 12307039
Thanks for your response.

That PDF does not load properly.  I just see blank pages.

Anyhow, I tried your suggestion.  It still gives me the same error:

> script test.txt /tmp/test.log
Scripted started, file is test.txt
No such file or directory
Script done, file is test.txt
>

What is the purpose of adding /tmp/test.log ?   The man page for the script utility only allows you to specify the name of the file to which you wish to record your session.  Why are you specifying two files on the command line (i.e. test.txt AND /tmp/test.log) ?

SYNOPSIS
     script [ -a ]  [ filename ]


Thank you.
0
 

Author Comment

by:jshantz4
ID: 12308722
I actually fixed this one myself:

I deleted my .cshrc file, and created a new one with default settings.  The script utility now works.  Thanks for your suggestions.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now