Change: Removed One file only editing mode in 8.1

Advertisement

magix
Guest

Change: Removed One file only editing mode in 8.1

I'm using this feature in 8.0 and it's very sad that it was removed in future versions.
Why I need it:
1. I connect to the sunOs server via scp with "bash -c 'sudo su - username'";
2. winScp do not pick up the PATH settings in .profile of username, I have a workaround for that - setting the PATH manually thru terminal(Ctrl+T).
3. When I edit the file it opens in new session(since 8.1) and PATH is not set, that's why it's not possible to save the changes.
Could you, please, advice any workaround for this situation?

Reply with quote

Advertisement

magix
Guest

Re: Change: Removed One file only editing mode in 8.1

magix wrote:

I'm using this feature in 8.0 and it's very sad that it was removed in future versions.
Why I need it:
1. I connect to the sunOs server via scp with "bash -c 'sudo su - username'";
2. winScp do not pick up the PATH settings in .profile of username, I have a workaround for that - setting the PATH manually thru terminal(Ctrl+T).
3. When I edit the file it opens in new session(since 8.1) and PATH is not set, that's why it's not possible to save the changes.
Could you, please, advice any workaround for this situation?
Or how to login(using "bash -c 'sudo su - username'") with PATH initialized?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,430
Location:
Prague, Czechia

Re: Change: Removed One file only editing mode in 8.1

I cannot test it now, but it may help if you move your settings from .profile to .bashrc. Or try to invoke bash a login shell (using --login switch I believe).

Reply with quote

magix
Guest

I have tried .bashrc - it's not read on start-up. .bashrc was in the home/username directory.
The same with --login switch - nothing is read from .profile, .bash-profile. Switch was used here: "bash -c 'sudo su - username' --login".
I have tried also "bash -c 'sudo su - username' --rcfile ./.bashrc" - no luck. :(

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,430
Location:
Prague, Czechia

magix wrote:

I have tried .bashrc - it's not read on start-up. .bashrc was in the home/username directory.
The same with --login switch - nothing is read from .profile, .bash-profile. Switch was used here: "bash -c 'sudo su - username' --login".
I have tried also "bash -c 'sudo su - username' --rcfile ./.bashrc" - no luck. :(
In fact you should tweak the inner shell (the one run by su), not the outter one.
However according to su docs, the dash switch should cause su to execute the inner shell as login. But maybe your default shell (the one that su execute) is not a bash at all. Also I do not understand what is purpose of the 'bash -c' at all. You should be able to do sudo su - username only.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum