I have the following Perl scripts (though this applies to Python and other scripting languages): `script1.pl`, `script2.pl`, `script3.pl`

The way these scripts where written, users execute them with input flags, and the output is a file saved. 

```
perl script1.pl --i input1.tsv   ## this outputs the file `outputs1`
perl script2.pl --i outputs1     ## this outputs the file `outputs2`
perl script3.pl --i outputs2     ## this outputs the file `final_output`

```

Now, I would like to create an executable bash script that allows users to simply work with `input1` and get the output in return `final_output`. 

Here's how I would do this with only one perl script, `execute.sh`:

```
#!/bin/sh

source ~/.bash_profile

FLAG1="--i=$1"

perl script1.pl $FLAG1

```

which could be run on the command line `execute.sh input1.tsv`

For my example with three scripts, how would I pipe the intermediate outputs into the intermediate scripts to created one `execute.sh` script, e.g. `outputs1` into `script2.pl`, then `outputs2` into `scripts3.pl`, etc.? 

Isn't there a way for me to do this without rewriting the perl/python scripts?
['https://unix.stackexchange.com/questions/341338', 'https://unix.stackexchange.com', 'https://unix.stackexchange.com/users/115891/']
I solved the problem like this...

**Node exporter:**

```none
ExecStart=/bin/sh -c '/usr/local/bin/node_exporter'

```

**Mysql\_exporter:**

```none
=/bin/sh -c '/usr/local/bin/mysqld_exporter \
 --config.my-cnf /etc/.mysqld_exporter.cnf \
 --collect.global_status \
 --collect.info_schema.innodb_metrics \
 --collect.auto_increment.columns \
 --collect.info_schema.processlist \
 --collect.binlog_size \
 --collect.info_schema.tablestats \
 --collect.global_variables \
 --collect.info_schema.query_response_time \
 --collect.info_schema.userstats \
 --collect.info_schema.tables \
 --collect.perf_schema.tablelocks \
 --collect.perf_schema.file_events \
 --collect.perf_schema.eventswaits \
 --collect.perf_schema.indexiowaits \
 --collect.perf_schema.tableiowaits \
 --collect.slave_status \
 --web.listen-address=0.0.0.0:9104'

```

**Here is the complete command:**

```
sudo vim /etc/systemd/system/mysql_exporter.service

```

**Content for `mysql_exporter.service`:**

```none
 [Unit]
 Description=Prometheus MySQL Exporter
 After=network.target

 [Service]
 Type=simple
 Restart=always
 ExecStart=/bin/sh -c '/usr/local/bin/mysqld_exporter \
 --config.my-cnf /etc/.mysqld_exporter.cnf \
 --collect.global_status \
 --collect.info_schema.innodb_metrics \
 --collect.auto_increment.columns \
 --collect.info_schema.processlist \
 --collect.binlog_size \
 --collect.info_schema.tablestats \
 --collect.global_variables \
 --collect.info_schema.query_response_time \
 --collect.info_schema.userstats \
 --collect.info_schema.tables \
 --collect.perf_schema.tablelocks \
 --collect.perf_schema.file_events \
 --collect.perf_schema.eventswaits \
 --collect.perf_schema.indexiowaits \
 --collect.perf_schema.tableiowaits \
 --collect.slave_status \
 --web.listen-address=0.0.0.0:9104'

 [Install]
 WantedBy=multi-user.target

```

**Node exporter:**

```
sudo vim /etc/systemd/system/node_exporter.service

```

**Content for `node_exporter`:**

```none
 [Unit]
 Description=Prometheus Node Exporter
 After=network.target
 User=prometheus
 Group=prometheus

 [Service]
 Type=simple
 Restart=always
 ExecStart=/bin/sh -c '/usr/local/bin/node_exporter'

 [Install]
 WantedBy=multi-user.target

```
I got this error. Solved as @Saex.

Reason for getting this error is that I have downloaded the wrong package `node_exporter-1.2.2.darwin-amd64.tar.gz` instead of `node_exporter-1.2.2.linux-amd64.tar.gz`

```
    node_exporter.service - Node Exporter
         Loaded: loaded (/etc/systemd/system/node_exporter.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Wed 2021-08-18 11:22:44 UTC; 17s ago
       Main PID: 3830 (code=exited, status=203/EXEC)

Aug 18 11:22:44 ip-10-0-101-80 systemd[1]: Started Node Exporter.
Aug 18 11:22:44 ip-10-0-101-80 systemd[3830]: node_exporter.service: Failed to execute command: Exec format error
Aug 18 11:22:44 ip-10-0-101-80 systemd[3830]: node_exporter.service: Failed at step EXEC spawning /opt/node_exporter/node_exporter: Exec>
Aug 18 11:22:44 ip-10-0-101-80 systemd[1]: node_exporter.service: Main process exited, code=exited, status=203/EXEC
Aug 18 11:22:44 ip-10-0-101-80 systemd[1]: node_exporter.service: Failed with result 'exit-code'.

```