shell


Devise script command utility with one simple line command


The script utility works like this:
$ script
Script started, file is typescript
$ ls
2 bin doubleline new1 play typescript
alok core filelist output pslist unix
$ ps
PID TTY TIME CMD
28149 pts/7 0:00 ksh.ms
$
Script done, file is typescript
After this contents of the typescript file are:
$ cat typescript
Script started on Wed Sep 07 05:56:26 2011
$ ls
2 bin doubleline new1 play typescript
alok core filelist output pslist unix
$ ps
PID TTY TIME CMD
28149 pts/7 0:00 ksh.ms
$
script done on Wed Sep 07 05:56:33 2011
$
I want to copy this behaviour with using other commands and I/O redirections.
The solution must be a one line command (may include pipelined commands).
Any help would be great, like if anyone can tell how can we redirect stdin, stdout and stderr to some file while all the data is still on the terminal.
$tee -a typescript | sh -i 2>&1 | tee -a typescript

Related Links

How can I execute a script that runs within an xterm/xgterm?
ssh executing nsenter as remote command with interactive shell in golang to debug docker container
ksh88 changing single quotes to double quotes inside heredocs?
Shell script replace variable with another variable have content & character by using sed
shell script that send email before exiting
how can we remove last 7 lines of file in unix [duplicate]
Shell Script improvement for getting diff result
hbase shell command - scan and Filter
How can I conditionalize a WiX custom action based on user priviledges
What does 1>&2 mean in shell? [duplicate]
UNIX: recursively paste a substring into the same string in unix
docker login in shell script dont work
Run a script every x seconds without waiting for it to complete
rename files in current folder (mandatory : for mv cut commands)
How to feed the output of one pipe to another pipe?
(Tcl?) Script for running modelsim with testbench as parameter from shell

Categories

HOME
string
telegram
flex
graphics
pclxl
knitr
sublimetext
newrelic
alsa
hugo
interpolation
watson-conversation
tput
http-post
internationalization
package.json
feathersjs
easyphp
html5-appcache
git-extensions
sencha-touch
microsoft-ocr
poedit
named-entity-recognition
dataflow-diagram
google-api-client
jboss6.x
nstimer
ms-access-2003
entity-relationship-model
tpm
comparable
cppreference
browser-sync
carrierwave
magento-1.8
mobx
anki
testbed
hibernate-validator
wacom
yowsup
openalpr
odroid
google-data-api
print-css
congestion-control
vaadin-charts
uiimage
vaadin-elements
double-click
bluez
lightning
x-ray
arq
tinkerpop
oracleclient
pdf-conversion
seq
rackspace-cloud
rmongo
materialized-path-pattern
simplepie
file-uri
uicolor
delta
clipboard.js
swizzling
mediametadataretriever
tracker-enabled-dbcontext
aurora
kiosk
redis-cluster
uiactionsheet
nupic
nio2
jaunt-api
asyncdisplaykit
android-launcher
opserver
ocra
apache-commons-daemon
botan
snoop
telepat
osc
mass-assignment
punycode
formview
mdichild
with-statement
websphere-esb
rfc5322
artemis
gd-graph
mvc-editor-templates
cnf
preload
tree-balancing
fitbounds
cgimage
apache-commons-dbutils
luabind
event-receiver
inline-formset
django-paypal
codebase
addchild
entitykey
ifilter
pnrp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App