English Amiga Board


Go Back   English Amiga Board > Support > support.AmigaOS

 
 
Thread Tools
Old 07 December 2022, 19:12   #1
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
CLI: Execute two commands

Is it possible to execute two commands on the same line in the CLI (in 3.0+) like you'd do with (unix) sh
echo foo; echo bar
or (windows) cmd
echo foo & echo bar
? If it matters, I don't care about echoing, I just want to run two programs (concretely something like <relative path>/download_program and program_copied <arguments>). Making a script with two lines works, but I find myself doing this in many different directories, and it's no big deal, but could save a few keystrokes .
paraj is offline  
Old 07 December 2022, 19:22   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Type command 1, press Control+J, type command 2. Return. Possibly there are also other ways.
Toni Wilen is offline  
Old 07 December 2022, 19:40   #3
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Thanks, that answers my question but made me realize I forgot an implicit requirement (sorry).

I now realize what I do is:
Code:
>cmd1
>cmd2 
up-arrow
up-arrow
enter
up-arrow
up-arrow
enter
With Ctrl-J it does what I asked, but up+enter only repeats cmd2 while I was hoping for cmd1+cmd2.
paraj is offline  
Old 07 December 2022, 20:21   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
With the Pipe command in C: and after following its installation instructions, you should be able to type cmd1 || cmd2.

http://aminet.net/package/util/shell/Pipe-1.5
thomas is offline  
Old 07 December 2022, 20:22   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,215
Quote:
Originally Posted by paraj View Post
Is it possible to execute two commands on the same line in the CLI (in 3.0+) like you'd do with (unix) sh
echo foo; echo bar
or (windows) cmd
echo foo & echo bar
?
Almost. "&" is the "run-back" indicator. You probably mean "&&" which concatenates commands.



The "&" exists since V45. The "&&" exists since V47.
Thomas Richter is offline  
Old 08 December 2022, 08:24   #6
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Thanks, the pipe commands does the trick on my ancient OS installation. Also good to know there's a built-in option once I get around to upgrading
paraj is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open source CLI commands Mrs Beanbag Coders. System 13 10 December 2016 09:50
Execute file without using execute VoltureX support.Apps 3 01 December 2011 09:59
List your favourite cli/shell commands replacements. ppill request.Apps 4 10 December 2010 14:48
Cli program to "execute" .info files olesio support.Apps 4 05 September 2010 19:19
Execute a list of commands by doublclicking an icon. e5frog support.Other 5 26 July 2010 16:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:56.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07084 seconds with 13 queries