Opening a usable xterm window through bash script

7,246

Solution 1

xterm -e "SOME COMMANDS; bash"

Solution 2

Found this post in 2020 and solution save me the day! Sharing the little script, just in case others need more help

#!/bin/bash

exec xterm -hold  -e 'date ; ls / ; bash' &
python3.6 /scratch/src/mouseNow.py

Share:
7,246

Related videos on Youtube

joe
Author by

joe

Updated on September 18, 2022

Comments

  • joe
    joe over 1 year

    I often have projects for which I need multiple terminal windows open at different locations, and setting up my workspace each time I want to work on this project takes a long time, so I'd like to be able to automate it with a script.

    I've only been able to get as far as this:

    xterm -hold -e "cd SOMEDIRECTORY && DO STUFF"
    

    But the problem with that is that it just executes the command and doesn't allow me to do anything else in that window. I'd like to be able to have the window open up to a certain directory, execute some commands there, and then allow me to do my own thing in that directory. How can I achieve this?