Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minor DWAINE append bug
#1
Generally, "^" is the "append to file" operator (like ">" in Linux).

You can use it to create multi-line files:

Code:
>echo line 1 ^ test
>echo line 2 ^ test
>cat test
]line 1
]line 2
]


You can also do that with |n, but it can get a bit ugly in some cases:
Code:
>echo line 1|nline 2 ^ test2
>cat test2
]line 1
]line 2
]


However, it seems that if you try appending to a program like this, it runs the program instead of running the command and appending it:
Code:
>echo #! ^ test3
>echo echo test 1 ^ test3
>echo echo test 2 ^ test3
]test 1
]
>cat test3
]#!
]echo test 1
]


Also, echo's help topic suggests you can try piping, but it doesn't seem to work at all:


Code:
>cat out
]~
]
>echo "this is some words" | out
]Unable to pipe stream to file.
>man echo
]Echo: Print text to current stream. Stream defaults to standard output (User terminal screen) if not piping.
]If piping, output is passed on. If the piping target is not an executable, an attempt will be made to write to that file.
]Usage: echo "text" OR echo "text" | pipe_file_name
#2
Blank lines in a DWAINE script cause the entire script to halt (treated as a break) as opposed to just being skipped/ignored. Combined with the fact that cat and echo love to insert additional new lines to text and it can make editing scripts extremely difficult


Forum Jump:


Users browsing this thread: 2 Guest(s)