I’m trying to make a Bash script that opens tmux and runs a few lines of commands and then detach it so I end up in my terminal after it’s done. How do I solve it? Tried everything.
≈#!/bin/bash
cd ~/data
mkdir $1
This is what I got so far. When running my Bash script I type in:
myScript folder_name https://myurl.com
And now I wanna start a tmux session and run:
screamingfrogseospider \
--crawl $2 \
--headless \
--save-crawl \
--output-folder ~/data/$1 \
--timestamped-output \
But how do I make a script that opens up tmux and runs these lines and closes also runs tmux detached so I end up in my terminal window?