Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I want to run a language sml and pass some "pre-determined" commands everytime. Now in bash I type sml to enter into sml terminal and now I use this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624

    Bash Scripting: Passing paramters to a called function


    Hi
    I want to run a language sml and pass some "pre-determined" commands everytime. Now in bash I type sml to enter into sml terminal and now I use this terminal. How do I use my bash script to pass some "pre-determined" commnds to this terminal.

    - use "abc.sml";
    > val it = 2.3 real.

    Help please.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Usually, that depends on the program itself. For example, Perl uses the -e switch to receive commands from the command line.

    If sml supports reading commands from stdin correctly, you can probably do something like this:
    Code:
    echo "some commands" | sml

  3. #3
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Quote Originally Posted by Dolda2000
    Usually, that depends on the program itself. For example, Perl uses the -e switch to receive commands from the command line.

    If sml supports reading commands from stdin correctly, you can probably do something like this:
    Code:
    echo "some commands" | sml
    That worked....thanks.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

Posting Permissions

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