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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:52:04+00:00 2026-06-09T16:52:04+00:00

I have this code: #!/bin/bash input=./user.cvs while IFS=’;’ read -r f1 f2 f3 f4

  • 0

I have this code:

#!/bin/bash

input="./user.cvs"

while IFS=';' read -r f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13
do

  path="./QRcodes/$f2$f3.png"

  vcard="BEGIN:VCARD%0AN;CHARSET=utf-8:$f3;$f2;;$f1;%0AADR;CHARSET=utf-8;INTL;PARCEL;WORK:;;$f10;$f11;;$f12;$f13%0AEMAIL;INTERNET:$f6%0AORG:$f4%0ATEL;WORK:$f8%0ATEL;FAX;WORK:$f9%0ATITLE:$f5%0AURL;WORK:$f7%0AEND:VCARD"

  latex=""

  encodedVCard=$(echo "$vcard" | sed -e 's/\+/\%2B/g')

  url="http://api.qrserver.com/v1/create-qr-code/?size=300x300&data=$encodedVCard"

  wget -O "$path" "$url"

  latex+="\n \\begin{tabular}{ C C } \\includegraphics[height=30mm]{graphic.png} & Name \\\\ \\end{tabular}"

  echo $latex

done < "$input"

Everything works except the ‘echo $latex’ always prints the same line instead of multiple times. What am I missing?

  • 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-09T16:52:05+00:00Added an answer on June 9, 2026 at 4:52 pm

    If you want to append to a string, just

    latex="$latex newstring"
    

    or

    latex=${latex}newstring
    

    You need to be careful that bash doesn’t interpret the above as a new var e.g. "$a4” would be interpreted as a variable a4 and not as $a with 4 appended.

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

Sidebar

Related Questions

I have code like this, which processes a CSV file: #!/bin/bash while read line
I have this bash code: #!/bin/bash ################################################### # Variables # BACKIFS=$IFS IFS=$'\n' db_file=$PWD/test path_db=$PWD
I have a code snippet, as follows. #!/bin/bash filename=tmp_list_filenames line_index=0 cat $filename | while
I have a code like this: #!/usr/bin/env bash test_this(){ export ABC=ABC echo some output
I have a Shell Scripts that read the Input #!/bin/bash echo Type the year
I have run this Perl code: #!/usr/bin/perl print content-type: text/html \n\n; print Hello World.\n;
This is my code for a bubble sort on n numbers: #!/bin/bash echo -n
I have a simple code which is: #!/bin/bash #LaTex code generator for figures. ls
Consider the following code snippet: #!/bin/bash #This program tests the if statement in bash.
I have the below code in a bash file called 'findError.sh': #!/bin/bash filename=$1 formatindicator=\|\

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.