Comments (3)
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.
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.
I close the issue
from anyrc.
Related Issues (18)
- Parse args HOT 1
- Support telepresence
- Bring tools into remote envs
- Question: Project vision HOT 1
- Bring specified env vars
- dockerrc tty option causes errors
- Unexpected control characters?
- Interactive shell looks duplicated
- Check overwriting in the install script HOT 1
- macos
- Better bash support
- Support `docker run -it` HOT 1
- Support ssh-agent w/ tmux correctly HOT 2
- Permission of `${ANYRC_ROOT}` HOT 2
- Use comprehensible names HOT 1
- POSIX shell compatibility
- The latest version will be always installed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anyrc.