News for hackers. Stuff that matters.
Re:Run Commands, the 'rc' in '.bashrc' by syncsynchalt on Sunday September 01, 2019 @06:33PM (#20855456)
As an example: I'd love to run `set -o vi` on every ec2-user login, but the machines tend to be ephemeral and this command might not be wanted by other users, so I don't add it to /etc/profile or /etc/bashrc.
Re:Run Commands, the 'rc' in '.bashrc' by jeremyjh on Sunday September 01, 2019 @10:05PM (#20856268)
Why wouldn't you put that in ~/.bashrc ?
Re:Run Commands, the 'rc' in '.bashrc' by syncsynchalt on Monday September 02, 2019 @05:23PM (#20861866)
The ec2-user is shared by all users who might login; our EC2 hosts usually only last a few minutes/hours and are only accessed during debugging or extraordinary circumstances.
Re:Run Commands, the 'rc' in '.bashrc' by jeremyjh on Monday September 02, 2019 @06:56PM (#20862320)
The .ssh/rc file goes on the server though, so you’d still have that problem.
Re:Run Commands, the 'rc' in '.bashrc' by ses1984 on Sunday September 01, 2019 @11:53PM (#20856661)
What if you don't have a home directory on an ephemeral server?
Re:Run Commands, the 'rc' in '.bashrc' by DHowett on Monday September 02, 2019 @12:53AM (#20856847)
Then you won’t have anywhere to store ~/.ssh/rc, and the version you’d put in /etc would still unfortunately apply to all users.
Re:Run Commands, the 'rc' in '.bashrc' by ses1984 on Monday September 02, 2019 @07:34AM (#20858442)
Your ssh rc is stored locally, to be executed on remote servers, right? Locally you have a home dir, but you don't on the remote.
Re:Run Commands, the 'rc' in '.bashrc' by aidos on Monday September 02, 2019 @07:54AM (#20858528)
No, it lives on the server.
Re:Run Commands, the 'rc' in '.bashrc' by soperj on Sunday September 01, 2019 @10:40PM (#20856398)
allows you to use vi on the command line for anyone else who was wondering.
Re:Run Commands, the 'rc' in '.bashrc' by soperj on Monday September 02, 2019 @01:12AM (#20856897)
okay? If i'm wrong, what's it for?
Re:Run Commands, the 'rc' in '.bashrc' by mikekchar on Monday September 02, 2019 @01:28AM (#20856954)
It could be worded better. It allows you to use vi style keybindings when editing a line in bash. By default bash uses emacs style keybindings. It doesn't actually use vi.
Re:Run Commands, the 'rc' in '.bashrc' by soperj on Monday September 02, 2019 @02:32AM (#20857165)
thanks.