🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #3995

Bash equivalent of cmd /k switch

#3995
From: Ben
Date: Tue, 02 Jun 2009 19:28
8 lines
1712 bytes
On Windows, cmd.exe has the /k switch, which lets you execute a
command given by a command-line argument, and then the shell remains
open after finishing the execution of the command. I know bash has -c
which lets you execute a command given by a command-line argument, but
then the shell closes after finishing the command (this is analogous
to the cmd.exe /c switch). My question is, is there a bash equivalent
of the cmd.exe /k switch that can be used to execute a command and
then remain open?
Technical Details
Message-ID: <c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!r16g2000vbn.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 4d82dd0a1,dfab991ae69ee2e,start
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!postnews.google.com!r16g2000vbn.googlegroups.com!not-for-mail
From: Ben <bgold12@gmail.com>
Newsgroups: comp.unix.shell,comp.unix.programmer,gnu.bash
Subject: Bash equivalent of cmd /k switch
Date: Tue, 2 Jun 2009 12:28:17 -0700 (PDT)
Organization: http://groups.google.com
Lines: 8
Message-ID: <c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.googlegroups.com>
NNTP-Posting-Host: 199.246.40.54
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1243970898 9779 127.0.0.1 (2 Jun 2009 19:28:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 2 Jun 2009 19:28:18 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: r16g2000vbn.googlegroups.com; posting-host=199.246.40.54; 
 posting-account=dZduOQoAAAAyiZ2odBLj6MlasZbptZ8w
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) 
 Gecko/2009042316 (CK-IBM) Firefox/3.0.10,gzip(gfe),gzip(gfe)