Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #234079

Re: .profile not being src'd at login on uptodate buster

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: .profile not being src'd at login on uptodate buster
Date 2021-04-10 20:30 +0200
Message-ID <C2qwN-7HS-5@gated-at.bofh.it> (permalink)
References (1 earlier) <C1i8h-64f-5@gated-at.bofh.it> <C1irE-6dB-1@gated-at.bofh.it> <C1jnH-6RA-7@gated-at.bofh.it> <C1nKF-187-5@gated-at.bofh.it> <C1odI-1jt-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 07 Apr 2021 at 21:46:30 (+0000), Lee wrote:
> On 4/7/21, Marco Ippolito <maroloccio@gmail.com> wrote:
> >> Where I want output, I protect it with:
> >>
> >>     [ -n "$PS1" ] && printf …
> >
> > Maybe consider:
> >
> > 	[[ -t 1 ]] && printf ...
> 
> Until your script that was started via crontab silently fails.  I
> *like* always having error messages enabled.

Here's the context, from Greg, again:

> Writing error messages to stdout from a .profile isn't generally the
> best idea.  Writing to stderr would be slightly better, but both of
> them should be avoided in a permanent configuration if possible.  Profiles
> that scribble to stdout or stderr during login can break things like scp.

Agreed, you certainly don't want that to happen when they're doing
their job non-interactively, because it could have major consequential
effects.

> As a *temporary* debugging measure, it's fine.

My start-up files, .bash_profile, .bashrc, and other files that
they source, contain permanent printf commands. When they finish
printing their output, the next thing that's going to happen is
that the shell will emit a prompt. So there's a certain elegance
in using that very prompt as the condition.

The thread, and my comment, was about the topic under discussion,
startup files, not scripts in general. Using PS1 as a condition
in the latter is unlikely to make much sense at all.

Cheers,
David.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

.profile not being src'd at login on uptodate buster Gene Heskett <gheskett@shentel.net> - 2021-04-07 14:20 +0200
  Re: .profile not being src'd at login on uptodate buster IL Ka <kazakevichilya@gmail.com> - 2021-04-07 14:30 +0200
    Re: .profile not being src'd at login on uptodate buster Gene Heskett <gheskett@shentel.net> - 2021-04-07 17:30 +0200
    Re: .profile not being src'd at login on uptodate buster Gene Heskett <gheskett@shentel.net> - 2021-04-07 17:40 +0200
  Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-07 14:40 +0200
  Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-07 17:10 +0200
  Re: .profile not being src'd at login on uptodate buster Lee <ler762@gmail.com> - 2021-04-07 17:20 +0200
    Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-07 17:40 +0200
      Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-07 18:40 +0200
        Re: .profile not being src'd at login on uptodate buster Marco Ippolito <maroloccio@gmail.com> - 2021-04-07 23:20 +0200
          Re: .profile not being src'd at login on uptodate buster Lee <ler762@gmail.com> - 2021-04-07 23:50 +0200
            Re: .profile not being src'd at login on uptodate buster Marco Ippolito <maroloccio@gmail.com> - 2021-04-08 14:30 +0200
            Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-10 20:30 +0200
              Re: .profile not being src'd at login on uptodate buster Lee <ler762@gmail.com> - 2021-04-10 21:00 +0200
                Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-10 21:30 +0200
                Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-11 16:20 +0200
                Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-11 16:50 +0200
                Re: .profile not being src'd at login on uptodate buster Lee <ler762@gmail.com> - 2021-04-11 19:10 +0200
                Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-11 20:00 +0200
                Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-12 17:20 +0200
                Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-12 17:30 +0200
                Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-12 18:10 +0200
                Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-11 16:20 +0200
                Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-11 16:50 +0200
                Re: .profile not being src'd at login on uptodate buster David Wright <deblis@lionunicorn.co.uk> - 2021-04-12 17:20 +0200
      Re: .profile not being src'd at login on uptodate buster Lee <ler762@gmail.com> - 2021-04-07 23:50 +0200
        Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-08 00:10 +0200
          Re: .profile not being src'd at login on uptodate buster Curt <curty@free.fr> - 2021-04-08 10:20 +0200
            Re: .profile not being src'd at login on uptodate buster Tixy <tixy@yxit.co.uk> - 2021-04-08 12:20 +0200
              Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-08 13:30 +0200
            Re: .profile not being src'd at login on uptodate buster Greg Wooledge <greg@wooledge.org> - 2021-04-08 13:40 +0200

csiph-web