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

  • SEARCH
  • Home
  • 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 4615302
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:49:14+00:00 2026-05-22T01:49:14+00:00

I am using vim to make a simple script trying get the output of

  • 0

I am using vim to make a simple script trying get the output of lm_sensors into another file. My problem is the formatting that needs to be done with requires combining two lines and outputting them into a file. Here is what I have currently:

LINE1=(echo -en System: INFO $(date +%x) $(date +%T) : CPU Temperature \{ ; sensors| grep Core\ sed 's/        /, /g'|tr -d '\n')
LINE2=(echo -e \})
echo $LINE1$LINE2 >> (FILE PATH)

LINE2’s sole purpose is to put a } bracket at the end of the data, so if there is a better way to do that all in one line I am all ears.

Disregarding the sed and tr commands which format the data, I would like the output data to look as follows, though I always get an ‘unexpected token ‘;” error message with the above script.

System: INFO (date time) : CPU Temperature { CPU Temp DATA }

I greatly appreciate all input.

  • 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-05-22T01:49:15+00:00Added an answer on May 22, 2026 at 1:49 am

    Try this, perhaps:

    LINE1=`echo -en System: INFO $(date +%x) $(date +%T) : CPU Temperature \{ ; sensors| grep Core\ sed 's/        /, /g'|tr -d '\n'`
    echo "$LINE1\}" >> (FILE PATH)
    

    Alternatively:

    (echo -en System: INFO $(date +%x) $(date +%T) : CPU Temperature \{ ; sensors| grep Core\ sed 's/        /, /g'|tr -d '\n')|while read line; do
       echo "$LINE1\}" >> (FILE PATH)
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using VIM in Windows. The problem is that I want to use
I'm trying to make Vim run the command 'CommandTFlush' whenever a new file is
Does my question make sense? Using either Vim or Emacs, you come to understand
Using Vim, I'm trying to pipe text selected in visual mode to a UNIX
I'm using vim to edit files that use a programming language where the end
I have been using the the vim integrated make command to help with my
Using Vim I often want to replace a block of code with a block
While using Vim (at home and at work), I often find myself doing similar
In using vim, when I start a comment with //, immediately after I type
I have recently started using Vim as my text editor and am currently working

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.