"script" doesn't seem to fully recognize one's environment
by rnturn from LinuxQuestions.org on (#5STN0)
I'm working on a project that, sadly, involves software that seems to have been written by people who love typing long commands (and don't mind correcting the inevitable typos). As a result, some of us have created aliases to reduce the maddening amount of typing that's necessary to execute commands.
Now... as part of a request to "show me how to do this" I tried running a series of these long commands via their aliases and log the session using "script". Oops! "script" doesn't know about all of my environment. Well, by "my environment" I mean the normal collection of shell variables as well as the aliases. That seems to be too expansive of a definition as "script" is unaware that aliases have been defined. I've been using that utility for years (starting on big iron Unixen) and never noticed this before.
Is this normal "script" behavior? -- I see no switches that might help me out.
Is there a workaround? -- The only one that comes to mind is to bite the bullet and write a short shell script that uses the long version of the commands and run that during the "script" session. One other possibility is to source my ".profile" when first logging the session. (Works but sort of a pain.)
Mostly curious if anyone else has run into this and whether there's a clever fix.
TIA...
Hope everyone's set to enjoy the holidays.
Now... as part of a request to "show me how to do this" I tried running a series of these long commands via their aliases and log the session using "script". Oops! "script" doesn't know about all of my environment. Well, by "my environment" I mean the normal collection of shell variables as well as the aliases. That seems to be too expansive of a definition as "script" is unaware that aliases have been defined. I've been using that utility for years (starting on big iron Unixen) and never noticed this before.
Is this normal "script" behavior? -- I see no switches that might help me out.
Is there a workaround? -- The only one that comes to mind is to bite the bullet and write a short shell script that uses the long version of the commands and run that during the "script" session. One other possibility is to source my ".profile" when first logging the session. (Works but sort of a pain.)
Mostly curious if anyone else has run into this and whether there's a clever fix.
TIA...
Hope everyone's set to enjoy the holidays.