script command

i have create a function in the .profile To get it work i log out and log in again . The function works fine, typing the name of the function"details" appears information for the system (who,time...)

The problem is when i start the script recording command the function does not really work
i don't know why does this
any help
??

What system are you running? Can you post a snippet or two of your code?

% cat .profile
details ()
{
date
echo My current directory is:
pwd
echo Users currently logged in
who
}

if this is what do you mean works fine

but whent i start the script command trying to record the function
and also its functionality tha function does not work

the whole thing is, i have to submit this to my tutor to see how i did it and if it works

props, this thread is really close to violating our rule against homework/classwork. But I will help you with this.

Your login shell reads your .profile and thus knows the function. The script command fires up a subshell and the subshell does not read your .profile. So as your first command after you run script, do this:
. .profile

Perderabo
Thank for the help works fine !!

just come down a bit with the " rules and regulations"
some people need help out there (don't be like my tutor")

Don't like our rules? Discuss it with Neo.

But I'm delighted to learn that I'm like your tutor! You must have a pretty good one. :slight_smile:

ok see for your self

http://www.unl.ac.uk/simt/staff/jayaram.shtml