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

Curl - disable all the jenkins jobs, that match a pattern
Decimal Help, should not be counting up
What is the Fully qualified file path when using google cloud shell file download in the browser
What does expression `${ID:-}` do in shell script? [duplicate]
Shell command to return value in json output
Add unified shell header in master detail application (SAPUI5)
compare 2 csv files in shell using awk
How to use less as a log file viewer?
Getting - The page is performing an async postback but the ScriptManager.SupportsPartialRendering property is set to false. error while using curl
Shell script to handle user options in binary file
How to determine if a folder exists and have file(s) in it in HDFS?
Shell script to grep more records having a text
Grep file with keyword in particular date (UNIX)
Finding files by filename at the speed of lightning
korn shell error [: missing `]'
Korn Shell - How can I make “Press any key to continue”

Categories

HOME
go
spark-streaming
cheerio
linkedin
themes
components
obfuscation
solaris
replace
edge
parameters
bookmarks
x264
android-json
pega
mod-security
zerobrane
flatpak
powershell-v5.0
job-scheduling
android-7.0-nougat
google-picker
google-container-registry
jmp
boost-icl
google-maps-autocomplete
blade
epsilon
game-theory
fractions
angular-translate
calculation
autodesk-designautomation
zend-debugger
twos-complement
reverse
arduino-ide
getlasterror
reason
flatmap
bc
unordered-map
apache-stanbol
laravel-elixir
portforwarding
wmp
angular-http
vaadin-charts
plan-9
getchar
magento-2.0.7
sonarlint-eclipse
identification
oracleclient
er-diagram
seq
latin
adafruit
file-uri
database-relations
invoke-sqlcmd
cycle2
state-restoration
dynatree
dllimport
opserver
canalyzer
haskell-warp
umlgraph
grouping-sets
filesplitting
punycode
encryption-asymmetric
radiant
vsx
script#
ui-select2
preload
xcode3.2
veracity
rmiregistry
appjs
update-statement
webdev.webserver
creole
strsep
unattended-processing
drupal-fivestar
technical-debt
xslcompiledtransform
contentpresenter

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App