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 need to have an idea to write a part of a program I
I have idea to write errors from my application to the Windows Event Viewer
I have no idea how to write a byteArray like this in CF b
Do you have an idea how to write the following code nicer/shorter :) I
I have an idea about a plugin to write for firefox, but have no
I have an idea to write a note-taking app in Java that does some
Does anybody have idea about how to post a wall on facebook after login
I have some bash scripts, some simple ones to copy, search, write lines to
If I have a file like this: A:a B:b C:c I need to create
Anyone have idea about how to bind Boolean in sqlite with objective - c.

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.