Git Product home page Git Product logo

ft_script's Introduction

FT_SCRIPT

ft_script is a simple recreation of the script command, designed to expolore the usage of pseudo-terminals in posix environments. ft_script sets up a pseudoterminal pair, where the slave is executed with the command specified by the invocation, or the value of $SHELL, or /bin/sh failing that. Input written to the shell is then forwarded to the pty slave, and the output of the slave is forwarded to the pty master, where it is written to the shell. All output written to the shell is duplicated to the specified file (or typescript if none provided), so that said file contains a record of the session started by ./ft_script.

Installation

git clone https://github.com/travmatth/ft_script
make

Usage

./ft_script [-aq] [file [command ...]]

-q: omit prologue/epilogue on terminal and typescript

-a: open typescript with append rather than truncate

Test

build tests: make Test=1 test_utils

execute tests: ./test/test_utils

Resources

  • Advanced Programming in the Unix Environment: Chapter 19: Pseudo Terminals
  • The Linux Programming Interface: Chapter 64: Pseudoterminals
  • Pty implementation: grantpt.c
  • Time implementation: time.c
  • IOCTL syscalls: IOCTL List

ft_script's People

Contributors

travmatth avatar

Watchers

 avatar  avatar

ft_script's Issues

manage path of executable

only executes with full path of given executable, else
script: <executable>: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.