0

I run Ubuntu 14.04 and installed the XFCE Terminal for some reason, and what I want to do is make a script to go to a folder on my hard drive under /Server/Gen2 and run several .sh scripts in different tabs of the XFCE Terminal, and use the nice command instead of running it directly because without the command my PC would lag. I also found tutorials but they only showed running one single script under multiple tabs, not multiple scripts under multiple tabs. Also I think it would be nice if the name of the tabs was changed to the name of the scripts as well so that I can tell which script is which. The reason for this is because I'm running a Gaming server and I don't like opening multiple windows and I want everything to be neat and in one place.

2

Try this:

#!/bin/bash

cd "/Server/Gen2"

options=()
tab=""
for file in *; do
    [[ -d $file ]] && continue # not a file
    [[ ! -x "$file" ]] && continue # not executable
    options+=($tab --title="$file"  -e "bash -ic \"nice -n 3 ./$file ; bash\"" ) 
    tab="--tab"
done

xfce4-terminal "${options[@]}"

To allow renaming the title, follow this https://askubuntu.com/a/22417

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.