🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4007

Re: Bash equivalent of cmd /k switch

#4007
From: Gordon Burditt
Date: Wed, 03 Jun 2009 04:37
22 lines
2781 bytes
>> Why not use .profile/.login/.kshrc/.bashrc as appropriate for the shell
>> being used?
>
>I would consider it rude for a script or program that creates a
>specialized shell to mess with those files.

I have seen some scripts that do this sort of thing by setting $HOME
to a newly-created temporary directory and it creates its own new
version of those startup files in that directory, then deletes them
when it's through.  I don't consider that rude.  Confusing, usually.

One place where it can be used to advantage is an emergency repair
disk, where you're booted off of floppy or CD, the normal root disk
is mounted somewhere else, and $PATH needs to be something decidedly
non-standard in order to do anything.  Something is broken, and
you're trying to fix it by, say, copying a critical shared library
off of the distribution CD to a filesystem being repaired, or restoring
a backup copy of the password file.

Another possible use for this involves environments inside jails or
chroot'ed setups.  You want a command shell *inside* the environment
so you can test your script or fix something.
Technical Details
Message-ID: <VMqdnWgjSaFpYLjXnZ2dnUVZ_j-dnZ2d@posted.internetamerica>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.posted.internetamerica!news.posted.internetamerica.POSTED!not-for-mail
References: <c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.googlegroups.com> <0d67cc76-a21f-40d0-a44f-16df03f78337@t10g2000vbg.googlegroups.com> <4a25c2ea$0$5514$b66e132@news.usenetserver.com> <c40b3cf6-2125-437f-a0b4-f72d8dc3c616@h2g2000yqg.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 4d82dd0a1,dfab991ae69ee2e
X-Google-Attributes: gid4d82dd0a1,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.posted.internetamerica!news.posted.internetamerica.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Jun 2009 23:37:08 -0500
Newsgroups: comp.unix.shell,comp.unix.programmer,gnu.bash
From: gordonb.idswz@burditt.org (Gordon Burditt)
Subject: Re: Bash equivalent of cmd /k switch
References: <c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.googlegroups.com> <0d67cc76-a21f-40d0-a44f-16df03f78337@t10g2000vbg.googlegroups.com> <4a25c2ea$0$5514$b66e132@news.usenetserver.com> <c40b3cf6-2125-437f-a0b4-f72d8dc3c616@h2g2000yqg.googlegroups.com>
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: gordon@hammy.burditt.org (Gordon Burditt)
Message-ID: <VMqdnWgjSaFpYLjXnZ2dnUVZ_j-dnZ2d@posted.internetamerica>
Date: Tue, 02 Jun 2009 23:37:08 -0500
Lines: 23
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 69.149.71.18
X-Trace: sv3-eWyN/CVujv5FlRPwoZrNvZ/UNDBvmJOtdAzb1hd9clF4xaCcWTqMcgf6Ke/eAQRV49wcwLX1vY2gwfA!7kv7nDcJx5kjBOlEDhdLbRq1hzYTtDNm2b6M+R6PVmiFg1gNVUWtnT5zxlfPux4v8swyJnduJWnN!oetwU9kH/VsF4WqD/jfEyFCpMqtdOii1jczXtqX48kjb
X-Complaints-To: abuse@airmail.net
X-DMCA-Complaints-To: abuse@airmail.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
X-Original-Bytes: 2532