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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:12:24+00:00 2026-05-21T16:12:24+00:00

I have no idea how to write Bash and after googling around for a

  • 0

I have no idea how to write Bash and after googling around for a while, I’m in no better position to achieve what I need.
I have a csv file consisting of a list of git submodules and their paths-to-be in the super project:

git://github.com/demo/git-repo.git, extensions/git-repo
git://github.com/demo/another-repo.git, extensions/another-repo

I would like to have a bash script which would read each line of the file, put each part of the line (separated by the comma) into the following command

git submodule add $1 $2

$1 being the git:// part and $2 being the extensions/ part

I need to be able to pass the filename of the csv file to the script, and not have it hardcoded in the script. If anyone can help me, I would really appreciate it as I have over 50 of these submodules to add regularly, and I’m fed up with writing it out one by one.

Cheers.

  • 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-21T16:12:25+00:00Added an answer on May 21, 2026 at 4:12 pm

    Since you only have 50 of these submodules, you can create a bash script to do this

    #!/bin/bash
    filename="$1"
    
    while IFS="," read one two
    do
      git submodule add "$one" "$two"
    done < "$filename"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this idea for a free backup application. The largest problem I need
I have idea to write errors from my application to the Windows Event Viewer
I have some bash scripts, some simple ones to copy, search, write lines to
do you have idea, if there would be some nice way to browse/log JMS
I have an idea for a simple application which will monitor a group of
I have an idea for how to solve this problem, but I wanted to
Anyone have any idea how to get the value of Language for Non-Unicode Programs
I have no idea. This causes seemingly random time-outs. These in turn break the
I have an idea for a web-based service. The implementation is very complex. There
I have no idea what is the rationale behind naming the vdev (virtual devices)

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.