Add a New Comment Rich Markup
I dislike this 2-level approach since it really junks up the contents of the script. Instead I wrote a utility (in the spirit of "xargs") that translates the argument-list into indexed ARGV variables argv ./screenrc config.xml and assigns ARGV1=config.xml where the $ARGV1 variable can be used inside the screenrc file. This isn't perfect but (I think) keeps it more readable.
At this point I think you are asking too much of how screen parses command line and would be better served by shell scripts around screen instead. There is nothing stopping shell script from generating a temporary screenrc file. And running screen with it. I'm even surprised that you can create executable screenrc and that it works ;) I would try something like this: #!/bin/sh TEMP=$(mktemp /tmp/generated-screenrc.XXXXXXXX) echo "focus right" >> ${TEMP} echo "screen -t \"Director Process\"" echo "exec ... ./bin/director ${1} localhost" screen -c${TEMP}
This is vaguely related to the problem of exposing more environment-variables for expansion, as noted in https://savannah.gnu.org/bugs/index.php?57628
If I put this at the top of a "screenrc" file #!/usr/bin/screen -c and mark the file executable -rwxr-xr-x 1 cponder dip 1094 Jan 18 20:19 screenrc I can actually run it as a command and use the screenrc programming convention to open windows and execute commands in them. What I'd like to do, though, is also pass a parameter to this script on the command-line, like ./screen config.1.xml and be able to use it inside the file, like focus right screen -t "Director Process" exec ... ./bin/director $1 localhost so the command-line parameter gets expanded on the 3rd line above.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.12