2010-10-26 23:50:58 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2020-08-07 20:20:30 +00:00
|
|
|
SERVER1=parallel-server1
|
|
|
|
SSHUSER1=vagrant
|
|
|
|
SSHLOGIN1=$SSHUSER1@$SERVER1
|
2022-05-23 19:31:44 +00:00
|
|
|
|
|
|
|
mkdir -p tmp
|
2010-10-26 23:50:58 +00:00
|
|
|
cd tmp
|
2023-01-30 21:51:56 +00:00
|
|
|
pwd=$(pwd)
|
|
|
|
# If not run in dir parallel/testsuite: set testsuitedir to path of testsuite
|
|
|
|
testsuitedir=${testsuitedir:-$pwd}
|
|
|
|
|
|
|
|
tar xjf "$testsuitedir"/input-files/testdir.tar.bz2
|
2022-05-23 19:31:44 +00:00
|
|
|
#rsync -Ha --delete input-files/testdir/ tmp/
|
|
|
|
#cd tmp
|
2010-10-26 23:50:58 +00:00
|
|
|
|
|
|
|
SERVER2=parallel@parallel-server2
|
|
|
|
|
2020-08-07 20:20:30 +00:00
|
|
|
echo $SSHLOGIN1 >~/.parallel/sshloginfile
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2013-03-23 20:44:17 +00:00
|
|
|
echo '### Test --wd newtempdir/newdir/tmp/ with space dirs';
|
2020-08-07 20:20:30 +00:00
|
|
|
ssh $SSHLOGIN1 rm -rf newtempdir;
|
2013-03-23 20:44:17 +00:00
|
|
|
stdout parallel -j9 -k --wd newtempdir/newdir/tmp/ --basefile 1-col.txt --trc {}.6 -S .. -v echo ">"{}.6 ::: './ ab/c"d/ef g' ' ab/c"d/efg' ./b/bar ./b/foo "./ ab /c' d/ ef\"g" ./2-col.txt './a b/cd / ef/efg';
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.6' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2013-03-23 20:44:17 +00:00
|
|
|
echo '### Test --wd /tmp/newtempdir/newdir/tmp/ with space dirs';
|
2020-08-07 20:20:30 +00:00
|
|
|
ssh $SSHLOGIN1 rm -rf /tmp/newtempdir;
|
2013-03-23 20:44:17 +00:00
|
|
|
stdout parallel -j9 -k --wd /tmp/newtempdir/newdir/tmp/ --basefile 1-col.txt --trc {}.7 -S .. -v echo ">"{}.7 ::: './ ab/c"d/ef g' ' ab/c"d/efg' ./b/bar ./b/foo "./ ab /c' d/ ef\"g" ./2-col.txt './a b/cd / ef/efg';
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.7' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
|
|
|
echo '### Test --workdir ...'
|
2013-10-21 20:31:52 +00:00
|
|
|
parallel -j9 -k --workdir ... --trc {}.1 -S .. echo ">"{}.1 ::: 2-col.txt
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.1' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2012-01-08 18:52:00 +00:00
|
|
|
echo '### Test --wd ...'
|
2013-10-21 20:31:52 +00:00
|
|
|
parallel -k --wd ... --trc {}.2 -S .. -v echo ">"{}.2 ::: 2-col.txt
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.2' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2012-01-08 18:52:00 +00:00
|
|
|
echo '### Test --wd ... with space dirs'
|
2013-10-21 20:31:52 +00:00
|
|
|
stdout parallel -j9 -k --wd ... --trc {}.3 -S .. -v echo ">"{}.3 ::: './ ab/c"d/ef g' ' ab/c"d/efg' ./b/bar ./b/foo "./ ab /c' d/ ef\"g" ./2-col.txt './a b/cd / ef/efg'
|
2010-10-26 23:50:58 +00:00
|
|
|
# A few rmdir errors are OK as we have multiple files in the same dirs
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.3' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2012-01-08 18:52:00 +00:00
|
|
|
echo '### Test --wd tmpdir'
|
2013-03-23 20:44:17 +00:00
|
|
|
parallel -j9 -k --wd tmpdir --basefile 1-col.txt --trc {}.4 -S .. -v echo ">"{}.4 ::: 2-col.txt
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.4' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
2012-01-08 18:52:00 +00:00
|
|
|
echo '### Test --wd /tmp/ with space dirs'
|
2013-03-23 20:44:17 +00:00
|
|
|
stdout parallel -k -j9 --wd /tmp/ --basefile 1-col.txt --trc {}.5 -S .. -v echo ">"{}.5 ::: './ ab/c"d/ef g' ' ab/c"d/efg' ./b/bar ./b/foo "./ ab /c' d/ ef\"g" ./2-col.txt './a b/cd / ef/efg'
|
2010-10-26 23:50:58 +00:00
|
|
|
# A few rmdir errors are OK as we have multiple files in the same dirs
|
2018-10-22 22:46:38 +00:00
|
|
|
find . -name '*.5' | LC_ALL=C sort
|
2010-10-26 23:50:58 +00:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
rm -rf tmp
|