echo command

OlafS3 · 577

OlafS3

  • Legendary Member
  • *****
    • Posts: 544
    • Karma: +50/-8
on: June 11, 2023, 09:13:09 AM
I am not sure if someone else can confirm it. I am currently trying to make my shell environment as compatible to amigados as possible

I had a example in manual echo "This is workbench $workbench"

workbench is obviously a env variable created by rom. On 3.1 it outputs f.e. 40.42

with sros echo I got "This is workbench $workbench"

echo command did not realize it is only placeholder. I replaced the echo command with one from aminet and added setenv workbench=40.42 and now it correctly output "this is workbench 40.42"

can someone confirm that behavior?



Mazze

  • Junior Member
  • **
    • Posts: 88
    • Karma: +36/-0
Reply #1 on: June 11, 2023, 09:23:24 AM
See screenshot. After setting the environment variable it works as expected. X86_64 ABIv1.



OlafS3

  • Legendary Member
  • *****
    • Posts: 544
    • Karma: +50/-8
Reply #2 on: June 11, 2023, 09:26:44 AM
thanx for testing. Then something was wrong at me



salass00

  • Newbie
  • *
    • Posts: 19
    • Karma: +25/-0
    • A500.org
Reply #3 on: June 11, 2023, 09:31:55 AM
The version of the echo command shouldn't matter as it's not it that handles replacing with the env variable contents, but the shell.

Also in AmigaDOS (unlike Linux) if the variable doesn't exist the variable name is printed as is, as you experienced. In Linux an empty string would be printed instead.



OlafS3

  • Legendary Member
  • *****
    • Posts: 544
    • Karma: +50/-8
Reply #4 on: June 11, 2023, 09:45:37 AM
thanx