0

This command works as expected.

if [[ "$fsb" > "19" || "$fsb" < "06" ]]; then
  xterm -name Xtermc
else
  xterm -name Xtermd
fi  

But this does not, neither xterm is produced, let alone running the script (x0 or x100) within it.

if [[ "$fsb" > "19" || "$fsb" < "06" ]]; then
  xterm -name Xtermc -e x0
else
  xterm -name Xtermd -e x100
fi  

Could someone kindly explain why?

user985675
  • 293
  • 3
  • 10

1 Answers1

1

This is most likely because x0 and x100 can't be found or exit immediately. Run

xterm -name Xtermc -e 'x0; read'

to see any error messages produced. If the command works fine, but finishes and exits immediately, you can get a prompt afterwards with

xterm -name Xtermc -e 'x0; bash'
that other guy
  • 116,971
  • 11
  • 170
  • 194
  • Behavior is as you predicted, "can't be found", but both scripts exist in my .bashrc, and execute normally if invoked directly – user985675 Mar 04 '13 at 18:37
  • 2
    `-e` requires an actual executable, not a shell function, which is what `x0` and `x100` appear to be when you say they "exist in [your] `.bashrc`". – chepner Mar 04 '13 at 18:42