Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Did you try piping the output linewise through some xargs wizardry echoing time and line? Or maybe awk even has a feature to do this.
-
@nitwhiz Look at links I provided
I don't want to pipe it. I want it beeing by default.
Sure I can do that :
bash |ts
And it works !
But I want it by default withfout adding a line of code.
Or maybe there is a way to do it on sign in ?
.
EDIT : Actually it doesn't work. It works only for "sucess" commands. -
Compile your own ssh client?
Or a script that pipes stuff to and fro and modifies it the way you want -
@IntrusionCM nah, it's about the output.
something like cat backup.log | xargs -I % -n1 sh -c 'echo $(date) %' or bash | ts
imo, proper rant. you want something specific, you don't get it - that's when you should write a rant..:D -
@IntrusionCM
Works for BASH lines, but not output.
But thanks ! That's one step closer
Example in a picture -
@NoToJavaScript if you *REALLY* want this, modify the exectued shell via:
https://unix.stackexchange.com/ques... -
@nitwhiz okay. It took me a while to grok it, mostly because it's weird in more than one way.
This is usually what you would achieve by using a logging system inside the application.
Everything outside will not have an "ms" exact timestamp.
If you want to log everything, you will have to send it to an syslog daemon.
I'm not 100 % sure if this is what he truly desires, but it's possible I guess.
You can use logger to redirect the output to eg rsyslog and use rsyslog to redirect it to a specific TTY. -
@IntrusionCM Hmm nop
It's just a fucking display. Some too,s are not loging timestamps. Sometime I run a 30 mins script and I want to know where is it ?
I just want to have a timestamp in front of each line. We have 4K screens now, we have pleanty of space even for SSH output.
The idea of recompiling SSH client seems better and better lol -
@010001111
Never heard of it and google search doesn't point to it on first page. (Only derivative things "Oh my z" or stuf like that)
So I'll pass -
@NoToJavaScript yes.
And what you describe is exactly what a logging system does. Enriching output with helpful information.
When you run a command, it gets directly printed to a specific TTY. Usually the TTY you're connected to.
That's what your program does.
You can either capture the programs output and enrich it by sending it to a logging daemon...
Or you'll have to change the output directly.
You could eg use Paramiko / Python, and instead of simply outputting each output line add additional content.
Or use a simple C exec wrapper...or bash script (logging might be far easier)
Either "capture" it and process it, or "wrap" it.
Bash or ZSH can start a program, but they cannot modify the output stream of an process. -
@NoToJavaScript “Z shell” https://en.wikipedia.org/wiki/...
My dayli driver. Nothing required to get started, just pick a theme from the “oh my zsh” (theming) community and you’re off to go!
Then, feel free to extend your theme using plugins! Add the Spotify plugin to NEVER LEAVE THE TERMINAL TO CHECK THE SONG NAME EVER AGAIN!
Sounds good? You’ll love it. Time stamps are just the beginning. -
@IntrusionCM I’m still switching between both, because he clearly posted a pic with the time stamp before typing the command.
But yes, any reasonable okay language can make a good std wrapper. Look, I’ll quickly make one in node... -
@010001111 yes.
Although - when you have rsyslog and spare time - you can really do insane stuff that you wouldn't want to do manually.
Multiplexing of many streams, eg.
And you have a fuckton of possibilities to output the stream... -
https://stackoverflow.com/questions...
This maybe but then with custom piping commands?
Otherwise @FrodoSwaggins might now! -
Root797674yClarification:
Do you want the time stamp at the beginning of each line, or each prompt?
Each line requires some magic.
Each prompt is trivial.
Prompt: modify your prompt. Derp.
Line: piping your ssh output into awk/sed should be enough. -
zain909-14y⦁ Academic Jobs Europe is a free job board for Academic and Research jobs in Europe. Find all kind of jobs, find it jobs in europe, academic position in a quick and efficient way
For more details
visit our
website
jobs.edu -
@Root Done for promt and pipe is workin with | ts. Would love it to be automaticlly aded to each command
-
Did you try piping it through some command?
Because we recommended this only like 5 times even though you do not want this. -
@010001111 @nitwhiz
Piping WORKS, I’ve already told that. Now I want it to be automagic.
So basically when I to “ls” it executes “ls | ts”
Output is perfectly what I want. But I don’t want to write | ts every time -
@010001111 @nitwhiz
Here is an example. If I can get THIS without adding | ts I will love my setup so much ! -
It kind of feels like what you're searching for isn't a terminal prompt modification as much as a logging trap.
http://ianzapolsky.com/posts/...
Linux is great
Linux can be customized
Welp, not so much. Simple things are not possible to do.
After 1H research I can't have timestamp near each line over SSH.
I'm not talking "history", i'm talking live.
basiclly I want to see timestamp on every single output line.
Basiclly this :
https://unix.stackexchange.com/ques...
But running automaticly for each command ever.
To be fair, same problem exists in PowerShell on windows
https://stackoverflow.com/questions...
And no, I don;'t want to switch to some random halfbaked teminal.
rant