Code Monkey home page Code Monkey logo

Comments (3)

amaya382 avatar amaya382 commented on June 8, 2024

Hi @pumpingiron ,

You can simply use surc, which is a part of this project, by creating a proper .anyrc. It should work the same as surc you defined.
If you want to preserve env vars in addition, pass -E flag provided by sudo to surc. Currently, surc uses sudo internally.

Here is a pseudo example

$ whoami
someuser
$ cat .anyrc
bash() {
  $(sh -c 'which bash') --rcfile "${ANYRC_HOME}/.bashrc"
}
$ cat .anyrc.d/.bashrc
alias ll='ls -Al'
source "${ANYRC_DANYRC}"
$ source .anyrc.d/.bashrc
$ ll # of course, you can use `ll` defined in .bashrc
$ export FOO=foo
$ surc -E root
# whoami
root
# echo $FOO
foo
# ll # you can also use `ll` defined in .bashrc w/ any accounts' env
# exit
$ whoami
someuser

from anyrc.

pumpingiron avatar pumpingiron commented on June 8, 2024

Hi @amaya382 ,

To tell you everything, I had already looked there, but my container got into trouble because I had several problems in my environment's custom configuration, so I prefered asking you how you would do it to save time.

Your reflection let me identify where the problems where and I was on the right track, and finally my configuration was well designed for historical Russell91/sshrc but not for yours because you really well improved it with all the mechanics that make the surc I've provided in my previous post unnecessary, and after having upgraded my configuration to take into account all of you improvements, i'm now able again to surc with what is expected.

Big thanks.

from anyrc.

pumpingiron avatar pumpingiron commented on June 8, 2024

I close the issue

from anyrc.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.