Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question receiving parameters - script and txt file


    Hi,

    I need to execute a script that also need to receive some parameters, however, these parameters are included on text file. this text file also has some paramters that need to be received. So, how can I do to execute the script? See below the examples:

    txt file (call - txt.file):

    AA=$1 BB=$2 CC=$3 DD=12345 EE=abcde

    (AA, BB and CC receive parameters, DD and EE always have the same value) - parameters $1, $2 and $3 could be passsed using the same line command that the script is executed)

    the script receives the txt file to be executed, but before executing, I need filling the parameters on txt file. Suppose that the script calls - tobeexec

    I thought that should be something like this:

    tobexec < txt.file

    but I dont know how to fill the parameters on txt.file before.

    Please, if someone knows how to solve it, I would appreciate it a lot.



    tks.

  2. #2
    hi,

    see the source, or . (dot) command, to source txt file in your script.

Posting Permissions

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