Похожие чаты

A while ago I made a customized version of bash's

time command, in the form of a script. Now I'd like to make every command that I run in the console run inside of that script. In other words, instead of timer sleep 5, it could just be sleep 5 and the shell would prefix that with the timer command. Is that possible? For what it's worth, I presume that a file of interest to configure this in would be the .bashrc file.

10 ответов

19 просмотров

A function in the bashrc can probably achieve this, however it would be more standard to define all of your commands as args to your script, inside the very script itself.

it's not a dry run, or is it?

Vim- Автор вопроса
B҉a̸͔tͥ̄ͅc͞h̢͊4̾̄̕2͗0̤̩ (G0J1R4)
it's not a dry run, or is it?

The commands portrayed in the screenshot have all been real executions, why?

Love your personal logs and the warm messages from server to user :)

arch huh?

Vim- Автор вопроса
Alexander Gnatyuk
Love your personal logs and the warm messages from...

Regarding this, thanks for the compliment! Currently I manage this intro message in /etc/motd, because it is shown regardless of how you establish a shell on the system (SSH/local, root/user, TTY/GUI, etc). That being said though, I am contemplating to move this to /etc/profile instead. The problem is that the MOTD file is just static text. The /etc/profile file meanwhile acts more like the shells' rc files, while not being tied to one particular shell. More specifically, this file can contain executable code. This can make the intro message a lot more interactive, and even make it more modular.

Vim
Regarding this, thanks for the compliment! Current...

Maybe you could look at Ubuntu sources. I remember they had some code to show you ads in motd, right?

Vim- Автор вопроса
Alexander Gnatyuk
Maybe you could look at Ubuntu sources. I remember...

Could work yeah, I'll check up on that. Similarly, I've also seen a package named Cockpit append its information to the intro message, without adjusting the motd file. Perhaps that could be worth looking into as well.

Похожие вопросы

Обсуждают сегодня

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
any reference of this implementation?
BitBuddha
29
Ⓐrtto, [4/23/24 7:02 PM] Please explain more fully how it is not working exactly, and what are the steps you are taking, and what error messages come or what happens. Ⓐrtto, ...
Ezza Kezza
2
sounds like people have lost their kaspa on tradeogre... does this mean tradeogre not trustworthy?
Ezza Kezza
15
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
So much speculation in the last week. So much volatility in price. This is because Hedera has a GC that isn't using the network it's governing. Why aren't people asking why a...
Summit Seeker R
9
Карта сайта