Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I'm getting a "ksh: SCRIPT: is read only" error whenever I run the following ksh script: Code: #!/bin/ksh set -o xtrace SCRIPT=`basename ${0}` BASENAME=`basename ${SCRIPT}` echo $BASENAME if [[ ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    6

    Question [SOLVED] read only variable?

    Hi

    I'm getting a "ksh: SCRIPT: is read only" error whenever I run the following ksh script:



    Code:
    #!/bin/ksh
    set -o xtrace
    
    SCRIPT=`basename ${0}`
    
    BASENAME=`basename ${SCRIPT}`
    
    echo $BASENAME
    
    if [[ -z ${SCRIPTS} ]]; then
            print "${SCRIPT}:Environment variable \"SCRIPTS\" is not defined. "
    fi
    Could anyone advise as to why?

  2. #2
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    [[ -z ${SCRIPTS} ]]

    Shouldn't it have been

    [[ -z ${SCRIPT} ]]

    instead ?

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    6
    hi nmset

    thx for the help! well spotted!!!

    Does this forum have a points awarding system?

Posting Permissions

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