M HYPE SPLASH
// updates

Is typescript for `script` command the same as TypeScript maintained by Microsoft? How to print using `ldr`?

By John Campbell

Is typescript for script command the same as TypeScript maintained by Microsoft? How to print using ldr ?

What exactly is typescript in relation to Linux/Ubuntu ?

Searching Google, I find that TypeScript is a superset of Javascript maintained by Microsoft. Is the output of script stored using this format?

I see that the output of script is binary.

How do I print a typescript file using ldr command ?

2 Answers

They are totally unrelated. Microsoft TypeScript is a programming language while under Unix and Linux typescript is the default output of the script command which is logging everything printed in you terminal session.

Don't be fooled by the binary status reported by file, it is due to embedded escape sequences. The better way to display typescript files is using the less -r command which preserves formatting/color commands that might be present in the file.

8

Take a look at the man script:

SYNOPSIS

 script [-a] [-c command] [-e] [-f] [-q] [-t[=file]] [-V] [-h] [file]

Notice that last [file] part. By default, if you simply run script without specifying where to store the file, it will save everything to a file called typescript. By contrast, if you run script somefilename everything will be saved to somefilename.

Now if we run file command on typescript to determine the file's type, we get this:

$ file typescript
typescript: ASCII text, with CRLF, CR, LF line terminators, with escape sequences, with overstriking 

As you can see, you've got simple text document there that is in no way related to Microsoft's TypeScript. Even more so, since this is a simple text document you should be able to print it with lpr command easily.

Word of caution though, if you have output of ls --color -F there, you might run into trouble, because ls adds special characters to colorize the files based on their type. Thus using simple \ls or dir is recommended

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy