konsole -T todo -e vi todo.txt &
konsole -T window1 -e ssh user@server &
konsole -T window2 -e ssh user@server2 -e cd directory &
The first two lines are working fine. The first opens a txt-file, the second opens a ssh-connection.
The third line should open a ssh-connection and then go to a dirctory, but it does not work. Can someone please tell me if it is possible to combine these two command in a script ?
Not being familiar with konsole , I'd guess you could combine several commands in a "list", i.e. adding them after another separated by semicolons, eventually enclosed in (double) quotes. On top, ssh does allow to specify a command as a parameter. Did you consider that?
Are you opening a remote session and then changing directory on that remote session? If you are you are doing it wrong as the -e option to ssh is not a "run this shell command" option.
Are you trying to keep the konsole open after the remote session closes, but change directory?
One wonders what the point of changing directory is supposed to be. If that is all you do, then then you command will complete and the ssh will terminate putting you back to the client and you have achieved nothing except you would get an error if the directory was not accessible.
What are you really trying to do? Some context might help us understand your real purpose.
@rbatte1: I guess the OP poster wants a new console window opened, which is logged into a different host AND placed in a certain directory - at least this would make sense, but we don't know for sure.
Of course there are several ways to achieve this, but unless we don't know the exact requirements, there is no point in making suggestions.