AmigaDOS tips and tricks

arnljot

Dad, gamer, nerd, amigian
Joined
Feb 5, 2008
Posts
3,849
Country
Oslo
Region
Oslo
One : Use environment variables
In a shell:
set MyVariable "MyValue"
echo $MyVariable
This will result in "MyValue" being printed, sans quotes.
Two : Use of PIPE:
Open two shell windows, in shell window 1:
type PIPE:mylist
This command wil seem to "hang".

In shell window 2:
list > PIPE:mylist
Shell window 1 will now start to print your list.


Three
: Have a commands result use as argument for the preceeding one.
Strings enclosed by "`" characters will be executed. Try this:
eval 5 + `eval 5 + 5`
This will output "15", sans quotes. The reason is that AmigaDOS will execute "eval 5+5" and use it as an argument for the first command


Four
: Better PIPE support
Download Andy Finkel Shell Tools from Aminet.
finkelshelltoo.lha

This, combined with the AmigaDOS 2.04+ feature of setting the private environment variable "_pchar" will do magic for us. the important command in the LHA archive is pipe, but they are all quite cool.

Add to S:User-Startup:
set _pchar="|"
Now test it out in shell:
list |more
Now your directory is displayed with the more command, and you have to press space for pages if your console isn't huge enough to list it at once
Five : Execute mulpile commands in one in shell
In a shell enter:
echo 1 , echo 2
This should output:
1 , echo 2
Now, enter in the same shell:
set _mchar=","
echo 1 , echo 2
This will output
Common values for _mchar are "&&" or "\". I used "," because I felt like it.
Six : Tab completion
Seven : File outpu
> and >> Are used to direct output from commands to files.
List > ram:list.txt
Will create a new file with the contents from List command, overwrite a file that's there
List >> ram:list.txt
Will append to a file that's there, or create it if it's not.
Eight : Command alias'
You can make short hand version of often used commands
alias e echo []
e Hello World
This will output
Hello World
The "[]" goes to indicate where the arguments should be put
 
Last edited:
Blimey! I had no idea how much UNIX-y goodness was present in AmigaDOS! All we need now is tab-completion and we're sorted!
 
When my miggy is up again, I'll expand this thread. It's a bit like "lost" knowledge to me. Once I had it, now I have to reclaim it.
 
Blimey! I had no idea how much UNIX-y goodness was present in AmigaDOS! All we need now is tab-completion and we're sorted!

AmigaDOS is a cut down version of Unix Andy. I'm suprised you didn't know this. :ninja:

Kin
 
Last edited:
My Amiga already has tab completion. Does CWB come with it already or something?
 
Another hint:
Code:
Assign.

 When you want to assign some place to a drive location, navigate to the desired drawer and type

 assign locate_you_want+: ""
 
Hey guys sorry for resurrecting this old thread but are there any reasons why my ' set _mchar="&&" ' doesn't work anymore?

mchar.jpg

I've always used it without any problems.
Now I'm using OS 3.1.4 upgraded from a previous 3.1 --> 3.9 installation.

Thanks in advance for any hints!
 
Some old bugs from 3.1 are fixed in 3.1.4, but some new bugs are introduced as well.......
 
Some old bugs from 3.1 are fixed in 3.1.4, but some new bugs are introduced as well.......

Isn't that always the case with any software upgrade :LOL:
 
Back
Top Bottom