Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9309767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:56:57+00:00 2026-06-19T00:56:57+00:00

can somebody pls help me understand what is happening here in lines started with

  • 0

can somebody pls help me understand what is happening here in lines started with headingcopy, linecopy, and sed, don’t fully understand what these headingcopy or linecopy mean as I don’t recognize these commands and, if they are variables, where are they used?…

GetReportParams|grep -iv conn|grep -v "^$"|while read DB_SCHEMA REP_IDX ORG_SHORT_NAME SQL_SCRIPT OUTPUT_FILE_NAME REPORT_NAME REPORT_TYPE OUT_FILE_EXT ORG_NAME MAIN_EMAIL BCC_EMAIL REPORT_GROUP PARAMETERS
do
  echo ======================================================================================
  export DATE=`date +%Y%m%d -d "1 day ago"`
  export OUTPUT_FILE_NAME="${OUTPUT_FILE_NAME}_$DATE.${OUT_FILE_EXT}"
  export OUTDIR=$OUTDIR_main/${ORG_SHORT_NAME}/${YEAR_MONTH}
  export SCPDIR=/$ORG_NAME/data_extracts/
  TMP_FILE_NAME="TMP_RUN_REPORT.txt" 
  echo Running report for -- $PARAMETERS
  # Remove text qualifier character
  PARAMETERSSEARCH=`echo $PARAMETERS | tr -d \'`
  HeadingCopy=`head -1 $OUTDIR_main/$MAIN_FILE_NAME | tee -a ${OUTDIR_main}/${TMP_FILE_NAME} `
  LineCopy=`grep ^"$PARAMETERSSEARCH" $OUTDIR_main/$MAIN_FILE_NAME | tee -a ${OUTDIR_main}/${TMP_FILE_NAME} ` 
  sed 's/[ \t]*$//' ${OUTDIR_main}/${TMP_FILE_NAME} > ${OUTDIR}/${OUTPUT_FILE_NAME}
  sed -i 's/[^,]*,//' ${OUTDIR}/${OUTPUT_FILE_NAME}
  #cat ${OUTDIR}/${OUTPUT_FILE_NAME}
  rm ${OUTDIR_main}/${TMP_FILE_NAME}

  rsync -a ${OUTDIR}/${OUTPUT_FILE_NAME} oracle@grnwebreports2:$SCPDIR
done

Thanks!
Leo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:56:59+00:00Added an answer on June 19, 2026 at 12:56 am
    HeadingCopy=`head -1 $OUTDIR_main/$MAIN_FILE_NAME | tee -a ${OUTDIR_main}/${TMP_FILE_NAME} `
    

    copies the first line from the file $OUTDIR_main/$MAIN_FILE_NAME to the variable HeadingCopy and also redirects(appends) the output to a file ${OUTDIR_main}/${TMP_FILE_NAME}

     LineCopy=`grep ^"$PARAMETERSSEARCH" $OUTDIR_main/$MAIN_FILE_NAME | tee -a ${OUTDIR_main}/${TMP_FILE_NAME} ` 
    

    copies the line which start with the string that is present in the variable PARAMETERSSEARCH and
    also redirects(appends) the output to a file ${OUTDIR_main}/${TMP_FILE_NAME}

    second sed will replacs every line the data in the file from the first character till it encounters a “,”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can somebody please help me with these questions about using the jquery blockui plugin
Can somebody help me understand the get & set ? Why are they needed?
Can somebody explain about Iterative Deepening A* ? I still don't understand how it
Can somebody please help me with the if statement and arrays. So for example
Can somebody help me with this. There is HTML code: <h3> <label> <input type=checkbox
I am still doing something wrong. Could somebody pls help me? I want to
Can somebody help me to use a timer exactly like stackoverflow's answer accept time
can somebody please explain, what exactly does it mean? I'm trying to understand what
Can somebody provide a working example of JavaScriptResult in asp.net mvc. I understand that
Can somebody help me convert the following html <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.