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

    exporting the result of a command in text

    I am trying to get the length of a file into a variable.

    In the script I am using:
    export FLEN= `wc -m ${SOURCE_FILE} | cut -c1-2 `
    echo ${FLEN}

    the result is:
    export: `59': not a valid identifier

    I want FLEN to = 59 in this case. How do I get redi of ` and ' in the above?


  2. #2
    try removing the space directly after the = sign, e.g.:
    export FLEN=`wc -m $SOURCE_FILE | cut -c1-2 `

  3. #3
    Thanks atreyu - that worked

  4. $spacer_open

Posting Permissions

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