Thanks for all the educational replies.
I should have been clearer about my exact requirements, but I learned more this way. My applicaton is an interface for encfs, emulating Fatdog developer jamesbond's right-click options in rox. The problem arose in this part:
Code: Select all
#create encrypted folder if it doesn't already exist
if [[ ! -d "$P/.$F" ]] ; then
xfce4-terminal -x bash -ic "encfs -f $P/.$F $P/$F"
until [[ -f $P/.$F/.encfs6.xml ]] ; do sleep 1 ; done
Now input pwd to open access
If the script continues before the encrypted folder is properly created, open for access fails and the script must be restarted. As you can see, I used the indicator file method since encfs creates an xml file in the encrypted folder, but I wanted to know how to do this in general. I think I count 2 methods so far:
--disable-server option of xfce4-terminal
wait for an indicator file
I learned a lot of useful new stuff even if it doesn't meet this particular requirement.
read -t n does not cause the script to wait for the terminal
bash at the end holds the terminal open, but does not detain the script
command1 && command2 I was using "[[ $? -eq 0 ]] && " for that