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 734175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:20:31+00:00 2026-05-14T07:20:31+00:00

Simply I need to write echo t${count} = $t${count} To a text file, including

  • 0

Simply I need to write

"echo" t${count} = "$"t${count}"

To a text file, including all the So the output would be something like:

echo "  t1  = $t1"

With ” as they are. So I have tried:

count=1
saveIFS="$IFS"
IFS=$'\n'
array=($(<TEST.txt))
IFS="$saveIFS"
for i in "${array[@]}"
do
echo "echo" t${count} = "$"t${count}""
(( count++ ))
done >> long1.txt

And variations on this such as:

echo "echo" """"" t${count} = "$"t${count}""

But I guess the wrapping in double ” is only for variables.

Ideas?

  • 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-14T07:20:32+00:00Added an answer on May 14, 2026 at 7:20 am

    There’s actually no wrapping in double quotes for variables, first quote starts, the second quote ends the quoted string. You may however concatenate strings however you want, so "$"t${count}"" will actually be equivalent to "$"t${count}, beginning with a quoted $-sign, followed by ‘t’, followed by the count-variable.

    Back to your question, to get a “, you can either put it in a literal string (surrounded by single quotes), like so echo '"my string"', note though that variables are not substituted in literal strings. Or you can escape it, like so echo "\"my string\"", which will put a literal ” in the string, and won’t terminate it.

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

Sidebar

Related Questions

I need to write a simple program that records all the input from parallel
I have a simple mod_rewrite question. What do I need to write in the
I need to simply wrap long text to display it in a few lines.
I have script which allows the user to choose an image and write something
I need to write a simple program for work that does the following: read
I need to write a simple C# .NET application to retrieve, update, and insert
I need to write a simple source control system and wonder what algorithm I
As a part of our application I need to write simple workflow system which
I'm using Dev C++ to write a simple C program and I need to
I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no

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.