Article View: comp.unix.shell
Article #4000Re: Bash equivalent of cmd /k switch
From: Lew Pitcher
Date: Tue, 02 Jun 2009 21:24
Date: Tue, 02 Jun 2009 21:24
25 lines
2007 bytes
2007 bytes
On June 2, 2009 15:28, in comp.unix.programmer, Ben (bgold12@gmail.com) wrote: > 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? No. Probably because bash isn't the right tool for /that/ job. Try xterm -e "ps ; exec bash" to get the equivalent of the CMD.EXE /k option. Note that CMD.EXE opens a GUI text window, executes commands in it, and closes it again; there is no direct equivalent to this in Unix, as bash (and all other shell processors) are not GUI, and do not open windows for themselves. OTOH, xterm /is/ GUI and /does/ open a text window in which you can run commands, including the command to run a shell interpreter. -- Lew Pitcher Master Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request ---------- Slackware - Because I know what I'm doing. ------
Technical Details
Message-ID:
<7a8f6$4a25987f$4c0aa020$8945@TEKSAVVY.COM-Free>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!TEKSAVVY.COM-Free-a2kHrUvQQWlmc!not-for-mailReferences:
<c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.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!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!TEKSAVVY.COM-Free-a2kHrUvQQWlmc!not-for-mail From: Lew Pitcher <lpitcher@teksavvy.com> Subject: Re: Bash equivalent of cmd /k switch Newsgroups: comp.unix.shell,comp.unix.programmer,gnu.bash Followup-To: comp.unix.shell Reply-To: lew.pitcher@digitalfreehold.ca Date: Tue, 02 Jun 2009 17:24:15 -0400 References: <c7e2ac57-0e67-4727-a1ca-f5e4adea3803@r16g2000vbn.googlegroups.com> Organization: The Pitcher Digital Freehold User-Agent: KNode/0.10.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: <7a8f6$4a25987f$4c0aa020$8945@TEKSAVVY.COM-Free> X-Complaints-To: abuse@usenetserver.com Lines: 27 X-Trace: 7a8f64a25987fe9af058508945