Results 1 to 2 of 2

Thread: Bash scripting with variables

  1. #1
    Join Date
    Oct 2011
    Beans
    2

    Question Bash scripting with variables

    How do you log a variable

    IE
    #!/bin/bash
    ECHO "insert some string, please"
    read var
    ??????
    ##?????? is an unknown code for logging $var to ~/.results/testlogs/test-mechanics-test.log

  2. #2
    Join Date
    Sep 2006
    Beans
    7,294
    Distro
    Lubuntu Development Release

    Re: Bash scripting with variables

    Do you mean something like this, using a redirect?

    Code:
    #!/bin/bash
    read -p "insert some string, please" var
    echo ${var} >> ~/.results/testlogs/test-mechanics-test.log

Tags for this Thread

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
  •