Is there anywhere, where the special characters used in interpreting strings in the shell is documented?? I know that *N is newline, but is there a character for tab as well? I tried *T, but it doesn't seem to work...
Also I could use a brushup on the general use of wildcards, but I can't seem to find anything in sys:Documentation...
There are loads of wildcards - your best bet is the ParsePattern() AutoDoc.
Not sure about escaped characters though - I'd suggest the AmigaDOS 3.1 (or 3.5 updated) manual. I'll have a look through some of my old amigaDOS manuals when I get home to see if I can find a comprehensive list.
Is there anywhere, where the special characters used in interpreting strings in the shell is documented?? I know that *N is newline, but is there a character for tab as well? I tried *T, but it doesn't seem to work...
The OS3.1 DOS manual only list 4 pairs of special characters for use in AmigaDOS commands: *E *N *" ** There may be an ANSI/ASCII escape sequence for embedding a TAB but I've never seen an example of that.
Quote:
Also I could use a brushup on the general use of wildcards, but I can't seem to find anything in sys:Documentation...
Look at the DOS autodoc in the SDK under the ParsePattern() function.
Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450
Thanks for all the input, I think I am getting a hang of it now.
Strange, though, that there is no way to send a tab character to a program, that could have been really useful.
The reason I am looking for this, is because I am looking for easy ways to replace strings in large sourcecode files with other strings. Now I am looking at sed the stream editor, and I think from using it a little and cross refering what I do on my pc, I think that sed has problems with the * character. I checked the DOS prefs, and "use asterisk in patterns" is turned off.
I'm trying to replace strings using something like this:
Original file: DC.B "string",10,0
Wanted result: .string "string" .byte 10,0
sed command: > sed "s/DC.B\t\"\([[:space:]0-9a-zA-Z]*\)\",\([01,]*\)/.string \"\1\"\n\t.byte \2/" myfile.asm >.log
Under cygwin it works, but on amiga it doesn't (in shell or sh). I was trying to look for the sources of sed on aminet, but it seems to be down... What to do??
@alfkil I can't help but think that it must be possible to embed tabs in AmigaDOS with escape codes but I can't get it to work. However, I have found a dumb way to send tabs to a text file using AmigaDOS. Here is an example:
If you enter the above commands in a shell, you should end up with a line containing a TAB before the word "here" in the file ram:test. If you can't find a better way, you should be able to use my method.
Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450
>alfkil Is there anywhere, where the special characters used in interpreting strings in the shell... What's the context? DOS or ABC shell?
>Chris Surely sed will use \t for tabs? Doesn't it use Perl-style regular expressions? ABC shell uses all the commands from "Bash" doesn't it! Best formatting text processing language is AWK.
I'd just see the sed documentation for numeric, ie. use the hexadecimal value for *, I did this for some other character when I needed it (you need 0x2A).