Skip to main content
Formatting and tags
Source Link
AdminBee
  • 23.6k
  • 25
  • 56
  • 77

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2
#!/bin/csh

command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for an one-liner with xargsxargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}',

cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}'

and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for an one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for an one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is

cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}'

and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

added 1 character in body
Source Link

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for aan one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for a one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for an one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

added 2 characters in body
Source Link

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for a one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this dodoes the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for a one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this do the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

I have a script like this:

#!/bin/csh

 command 1 \
   -f \"input1\" \
   -l input2 -other_swithes1

 command 2 \
   -f \"input1\" \
   -m input2 \
   -l input3 -other_swithes1

  command 3 \
   -f \"input1\" \
   -l input2 -other_swithes2

so any idea for a one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

added 277 characters in body
Source Link
Loading
Source Link
Loading