Professional Web Applications Themes

Unix equivalent of Dos commands - SCO

I am trying to send strings of data to a customer display connect to /dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in dos, but I want to test in out in unix. The manual says to do the following dos commands: mode com1 96,n,8,1 type con>com1 then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH" on the first line. Press Ctrl-C to end. In dos, I can sit there all day and type in various strings and it works, but I don't know how to do this in unix. I believe that I ...

  1. #1

    Default Unix equivalent of Dos commands

    I am trying to send strings of data to a customer display connect to
    /dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in
    dos, but I want to test in out in unix. The manual says to do the following
    dos commands:

    mode com1 96,n,8,1
    type con>com1

    then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH"
    on the first line. Press Ctrl-C to end.

    In dos, I can sit there all day and type in various strings and it works,
    but I don't know how to do this in unix. I believe that I have the settings
    for tty2a set correctly as I can type echo $string > /dev/tty2a and it
    displays. The problem with this testing is that the device has to be reset
    after each line because it needs a cr/lf to end one line and begin accepting
    another.

    Any help is greatly appreciated.

    Justin


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03


    justin Guest

  2. #2

    Default Re: Unix equivalent of Dos commands

    "justin" <justin_robbsNO_SPAMhotmail.com> wrote in message
    news:bdcjh4$n87$1news.tdl.com...
    > I am trying to send strings of data to a customer display connect to
    > /dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in
    > dos, but I want to test in out in unix. The manual says to do the
    following
    > dos commands:
    >
    > mode com1 96,n,8,1
    > type con>com1
    >
    > then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH"
    > on the first line. Press Ctrl-C to end.
    >
    > In dos, I can sit there all day and type in various strings and it works,
    > but I don't know how to do this in unix. I believe that I have the
    settings
    > for tty2a set correctly as I can type echo $string > /dev/tty2a and it
    > displays. The problem with this testing is that the device has to be
    reset
    > after each line because it needs a cr/lf to end one line and begin
    accepting
    > another.
    >
    > Any help is greatly appreciated.
    >
    Read the man page for echo
    echo $string\r\n

    Ron





    Ronald J Marchand Guest

  3. #3

    Default Re: Unix equivalent of Dos commands

    On Wed, Jun 25, 2003 at 10:44:19AM -0600, justin wrote:
    >I am trying to send strings of data to a customer display connect to
    >/dev/tty2a in Openserver 5.0.5. The use manual explains how to do this in
    >dos, but I want to test in out in unix. The manual says to do the following
    >dos commands:
    >
    >mode com1 96,n,8,1
    >type con>com1
    >
    >then type "!#1ABCDEFGH" and press enter. The display will show "ABCDEFGH"
    >on the first line. Press Ctrl-C to end.
    >
    >In dos, I can sit there all day and type in various strings and it works,
    >but I don't know how to do this in unix. I believe that I have the settings
    >for tty2a set correctly as I can type echo $string > /dev/tty2a and it
    >displays. The problem with this testing is that the device has to be reset
    >after each line because it needs a cr/lf to end one line and begin accepting
    >another.
    The ususal answer is ``there's more than one way to do it''. The Unix
    ``write'' command is traditionally the way this is done.

    Writing directly to a user's tty device may work, but probably won't on a
    properly configured system since it has many security implications. (how
    would you like to be running as root and have your F1 key reprogrammed to
    send ``rm -fr /'')?

    Things are muth more compilicated in a multi-user environment than on the
    average DOS/Windows machine where there's only one user with one console
    device. Even if I'm running an *ix box from the console, there are 12
    different ttys I might be on so how do you know which one to write to (when
    I was running Xenix I used all 12 of them)?

    Bill
    --
    INTERNET: [email]billCelestial.COM[/email] Bill Campbell; Celestial Software LLC
    UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
    FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
    URL: [url]http://www.celestial.com/[/url]

    ``It is better to die on your feet than to live on your knees!''
    -- Emiliano Zapata.
    Bill Campbell Guest

  4. Moderated Post

    Default Re: Unix equivalent of Dos commands

    Removed by Administrator
    justin Guest
    Moderated Post

  5. #5

    Default Re: Unix equivalent of Dos commands

    On Wed, Jun 25, 2003 at 12:19:51PM -0600, justin wrote:
    >
    >-snip-
    >
    >> Writing directly to a user's tty device may work, but probably won't on a
    >> properly configured system since it has many security implications.
    >
    >I am just trying to write a string of data to an output only device
    >connected via a serial port.
    ....
    >However, since this is just a customer display for a cash register, I don't
    >think there is anything to worry about. ;)
    Writing to a serial port compilicates things a bit since one has
    to insure that it's parameters are set correctly (e.g. baud rate,
    parity, etc.) -- something like:

    stty 9600 cs8 -onlcr clocal < /dev/tty1a

    The stty command allows you to set how the end-of-line stuff is
    handled as well, and can be used to automatically supply CRLF.

    Bill
    --
    INTERNET: [email]billCelestial.COM[/email] Bill Campbell; Celestial Software LLC
    UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
    FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
    URL: [url]http://www.celestial.com/[/url]

    Government is actually the worst failure of civilized man. There has
    never been a really good one, and even those that are most tolerable
    are arbitrary, cruel, grasping and unintelligent.
    -- H. L. Mencken
    Bill Campbell Guest

  6. #6

    Default Re: Unix equivalent of Dos commands


    "Bill Campbell" <billcelestial.com> wrote in message
    news:20030625114331.B26393barryg.mi.celestial.com ...
    > On Wed, Jun 25, 2003 at 12:19:51PM -0600, justin wrote:
    > >
    > >-snip-
    > >
    > >> Writing directly to a user's tty device may work, but probably won't on
    a
    > >> properly configured system since it has many security implications.
    > >
    > >I am just trying to write a string of data to an output only device
    > >connected via a serial port.
    > ...
    > >However, since this is just a customer display for a cash register, I
    don't
    > >think there is anything to worry about. ;)
    >
    > Writing to a serial port compilicates things a bit since one has
    > to insure that it's parameters are set correctly (e.g. baud rate,
    > parity, etc.) -- something like:
    >
    > stty 9600 cs8 -onlcr clocal < /dev/tty1a
    >
    > The stty command allows you to set how the end-of-line stuff is
    > handled as well, and can be used to automatically supply CRLF.
    >
    Is there any way to write to it without using echo. In dos, once I ran
    "type con>com1", I was able to send data that I typed directly to it. I
    guess I could put the strings in a file and use pg or more to send it to
    tty2a. However, I would really like to play around with the different
    command sequences that it accepts and figure out how to make it do what I
    want.

    Thanks,
    Justin


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03


    justin Guest

  7. #7

    Default Re: Unix equivalent of Dos commands

    In article <bdcvkl$qir$1news.tdl.com>,
    justin <justin_robbsNO_SPAMhotmail.com> wrote:
    >Is there any way to write to it without using echo. In dos, once I ran
    >"type con>com1", I was able to send data that I typed directly to it. I
    >guess I could put the strings in a file and use pg or more to send it to
    >tty2a. However, I would really like to play around with the different
    >command sequences that it accepts and figure out how to make it do what I
    >want.
    Configure the device as a direct uucp device, and then connect to it with cu.
    For example, put in /usr/lib/uucp/Devices:

    Direct tty2a - 9600 dir

    Then:
    chown uucp:uucp /dev/tty2a

    cu -l tty2a dir

    Use ~. at the start of a line to exit cu (probably best to read the cu man page
    before you use it).

    John
    --
    John DuBois [email]spcecdtarmory.com[/email] KC6QKZ/AE [url]http://www.armory.com/~spcecdt/[/url]
    John DuBois Guest

  8. Moderated Post

    Default Re: Unix equivalent of Dos commands

    Removed by Administrator
    Bill Vermillion Guest
    Moderated Post

  9. #9

    Default Re: Unix equivalent of Dos commands

    Thanks for all the helpful responses. That got me what I needed. I
    appreciate you guys. Have a good day and God Bless.

    Justin


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/03


    justin Guest

Similar Threads

  1. please tell me what are the following unix commands:
    By Mario in forum Linux / Unix Administration
    Replies: 8
    Last Post: March 5th, 03:23 AM
  2. Solaris equivalent commands for HP and AIX
    By Dave in forum Linux / Unix Administration
    Replies: 3
    Last Post: February 15th, 03:55 PM
  3. Help with UNIX commands
    By Mame Mbodji in forum PERL Beginners
    Replies: 5
    Last Post: November 17th, 12:30 AM
  4. Need help with UNIX compiler commands
    By Les Coover in forum AIX
    Replies: 5
    Last Post: September 8th, 09:40 PM
  5. Using external Unix commands
    By C S Secret in forum PERL Beginners
    Replies: 0
    Last Post: September 3rd, 02:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139