News for hackers. Stuff that matters.
Re:Start all of your commands with a comma (2009) by Timpy on Thursday June 23, 2022 @04:11PM (#31854551)
If I unknowingly named my command the same as some system command and the custom command ends up earlier in my path it doesn't really cause any problems does it? I wasn't using that system command anyways, and my custom command is only going to take priority if my .bashrc file was run first.
Re:Start all of your commands with a comma (2009) by Taywee on Thursday June 23, 2022 @04:15PM (#31854599)
It can if you are executing programs that then try to execute those commands and get your commands instead.
Re:Start all of your commands with a comma (2009) by nerdponx on Thursday June 23, 2022 @04:39PM (#31854851)
I wish it was easier to create "snapshots" of a particular set of environment variables in order to use them later as run environments. I also wish that Unix desktop environments generally made it easier to manage env vars, but that's another complaint. And don't get me started on PAM env vars...
Re:Start all of your commands with a comma (2009) by fragmede on Thursday June 23, 2022 @05:38PM (#31855473)
Re:Start all of your commands with a comma (2009) by nerdponx on Thursday June 23, 2022 @10:11PM (#31857129)
I use Direnv in all of my projects, but it doesn't make it any easier to manage consistent groups of env vars or assign different executables to run in different groups.
Re:Start all of your commands with a comma (2009) by LanternLight83 on Thursday June 23, 2022 @06:59PM (#31856161)
Direnv has been mentioned, and it meshes well with functional package managers like Nix and Guix, each of which include the concept of "Profiles". Each profile can access a specific set of programs via it's environment, but PATH is far from the last variable that you can use Direnv or Profiles to control.
Re:Start all of your commands with a comma (2009) by OJFord on Thursday June 23, 2022 @05:01PM (#31855118)
Just env vars?

    env > "$(date +s).env-snapshot"
(And use it again slightly more awkwardly as

    <$file | xargs -I@ echo '"@"' | tr '\n' ' ' | xargs -I@ env @ cmd
or something more convenient to `cmd`.)
Re:Start all of your commands with a comma (2009) by sigjuice on Thursday June 23, 2022 @08:07PM (#31856565)
Should be

  <$file xargs ...
Re:Start all of your commands with a comma (2009) by OJFord on Friday June 24, 2022 @05:20AM (#31859441)
Oops, you've exposed that it started off as a useless cat I knew I'd be chastised for ;)
Re:Start all of your commands with a comma (2009) by sigjuice on Friday June 24, 2022 @05:37PM (#31869688)
:)

If it is any consolation, I can't make any sense of this.

  $ <xyz.txt wc -l
         8
  
  $ <xyz.txt | wc -l
         0
Re:Start all of your commands with a comma (2009) by verrp on Thursday June 23, 2022 @06:10PM (#31855734)
> I wish it was easier to create "snapshots" of a particular set of environment variables in order to use them later as run environments.

docker gives you this (but only as part of a whole ecosystem, which for various reasons you might not want to hitch your horse to).

Re:Start all of your commands with a comma (2009) by xigoi on Thursday June 23, 2022 @04:15PM (#31854592)
Until you use a different machine and accidentally type your command without realizing it's not there.
Re:Start all of your commands with a comma (2009) by tasuki on Thursday June 23, 2022 @04:17PM (#31854632)
Yes, all of that. And if you later decide to start using the system command, you just rename your custom command.
Re:Start all of your commands with a comma (2009) by eriner_ on Thursday June 23, 2022 @04:48PM (#31854958)
I use zsh and have the following alias (rather, function):

``` cp () { rsync -avhW --progress --inplace ${@} } ```

If I ever need to use the `cp` binary, I execute `=cp`, which evaluates to `/bin/cp`.

Re:Start all of your commands with a comma (2009) by arjvik on Saturday June 25, 2022 @11:47AM (#31876187)
Why use rsync? Only for the progress bar?