Reply to topic

Execute Multiple or Aliased Commands in --tabs-from-file

mrm
Registered Member
Posts
3
Karma
0
I want to be able to launch a konsole with multiple tabs running various commands. The --tabs-from-file option is great for this, however it can't find aliased commands from the .my_cshrc file and will not even open tabs running multiple commands.

Here is a sample config file:

Code: Select all
title: tab1 ;; command: alias-command ;;
title: tab2 ;; command: pwd; ls ;;


This will open a tab titled 'tab1' with an error message: "Warning: Could not find 'alias-command', starting '/bin/tcsh' instead. Please check your profile settings."
'tab2' will simply not open at all. I've tried enclosing multiple commands in single quotes, but it didn't work.

How can I load konsole tabs that will recognize aliased commands in the config file? May be important to know that the tabs that open can run aliased commands, but just aliased commands in the config file don't work.

How can I have multiple successive commands execute in one tab?
airdrik
Registered Member
Posts
1390
Karma
2
OS
I believe you need to tell it to invoke csh with the alias commands as arguments:
Code: Select all
title: tab1 ;; command: csh -c "alias-command" ;;
title: tab2 ;; command: csh -c "pwd; ls" ;;


airdrik, proud to be a member of KDE forums since 2008-Dec.
mrm
Registered Member
Posts
3
Karma
0
airdrik wrote:I believe you need to tell it to invoke csh with the alias commands as arguments:
Code: Select all
title: tab1 ;; command: csh -c "alias-command" ;;
title: tab2 ;; command: csh -c "pwd; ls" ;;


This did not work. Any tab with a csh -c command did not open at all.
airdrik
Registered Member
Posts
1390
Karma
2
OS
Looks like to keep the tabs open for non-interactive invocations you need to include the --hold option to konsole.
(There may be some additional kinks to work out around issuing multiple commands as when I tried (using bash as I don't have csh installed), I kept getting complaints about missing matching quote, or otherwise not running both commands.)


airdrik, proud to be a member of KDE forums since 2008-Dec.
mrm
Registered Member
Posts
3
Karma
0
airdrik wrote:Looks like to keep the tabs open for non-interactive invocations you need to include the --hold option to konsole.
(There may be some additional kinks to work out around issuing multiple commands as when I tried (using bash as I don't have csh installed), I kept getting complaints about missing matching quote, or otherwise not running both commands.)


--hold keeps tabs that would have otherwise closed (either those calling csh -c or ones with multiple commands). However these tabs cannot be used to execute other commands. They remain open and even ctrl-c does not fix it.

Keeping the tabs open also revealed that csh -c alias-command was not working. Those tabs just display "alias-command: Command not found."
airdrik
Registered Member
Posts
1390
Karma
2
OS
Adding --hold only instructs konsole not to close the tab/window when the csh process it was started with exits, which is useful for examining the output of some series of commands or figuring out why something isn't running the way you expected.

Sounds like you want the tabs to start interactive csh sessions each of which runs one or more initial commands. For that you'll have to dig a little more into the workings of csh, and how to get it to run different scripts at the start of different interactive sessions.


airdrik, proud to be a member of KDE forums since 2008-Dec.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], bovender, Deevad, Exabot [Bot], Google [Bot], mikenewman, robgriff444, zaldymacalalad