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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:07:57+00:00 2026-06-04T05:07:57+00:00

I have following jobs (just as example) to run in unix (bash shell) cluster

  • 0

I have following jobs (just as example) to run in unix (bash shell) cluster computers:

### job1
mkdir file01
cp *.map  flex01
date > out
cd ..

### job2
mkdir file02
cp *.map  flex02
date > out
cd ..

### job3
mkdir file03
cp *.map  flex03
date > out
cd ..

### job4
mkdir file04
cp *.map  flex04
date > out
cd ..

If I submit these jobs, we do one by one. But I want to run them in parallel means that job1 to job4 running at the same time at the background.

How can I do it ? Sorry for the simple question, I am new to unix.

  • 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-04T05:08:00+00:00Added an answer on June 4, 2026 at 5:08 am

    The cd commands don’t seem to be a good idea; you don’t cd into a directory. You’ll probably also want to append the date information to the output file, rather than always clobber it. It also seems more likely that you’d copy the map files to the directory you just created. So, you might write:

    (mkdir flex01; cp *.map flex01; echo "Job 1: $(date)" >> out) &
    (mkdir flex02; cp *.map flex02; echo "Job 2: $(date)" >> out) &
    (mkdir flex03; cp *.map flex03; echo "Job 3: $(date)" >> out) &
    (mkdir flex04; cp *.map flex04; echo "Job 4: $(date)" >> out) &
    
    wait
    

    This runs each sequence of commands as a separate background job, and then waits for them all to finish before proceeding. You could look at using a loop for this task, too.

    for n in $(seq 1 4)
    do
        (mkdir flex0$n; cp *.map flex0$n; echo "Job $n: $(date)" >> out) &
    done
    

    You could also consider using mkdir -p flex01 so you don’t get error messages when trying to create a directory that already exists. (Or you could test for errors and not copy if it exists, or test for existence before running mkdir, or clean it out before copying if it already exists, or …)

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

Sidebar

Related Questions

I have the following code: $SQL = UPDATE jobs SET read = '1' WHERE
I have the following: IEnumerable<Job> jobs jobs = from t in table.GetAll() select new
I have the following two tables: Jobs AreaID, JobNo (composite key) Logs LogID, AreaID,
Say I have the following many to many with jobs and users Assignment: columns:
i have a JSON array have the following data structure Jobs: [ { id:
I have the following from the server response: {invalid_emails:[adsasdasd],result:success,valid_emails:[jobs@apple.com]} But this errors? $.ajax({ type:
I have the following XML: <employees> <employee> <!--forgot to include an attribute--> <name>John</name> <jobs>
I have the following (errorous) Xml: <jobs> <job> <id>1</id> <state><![CDATA[IL]]></state> </job> <job> <id>2</id> </job>
I have the following code: <div class='menu'> <div class='menu_1'> <a href='../test.php'>JOBS</a> </div> <div class='menu_2'>
I have the following way to submit a job with cluster using qsub: Submitting

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.