There's a part of my setup that I never want to run when calling it through command line, but always run it through the interface.
I was doing this through a [task], and simply not passing that particular task in the command line options.
My problem is, when running this setup through the interface, I don't even want to give this option to the user, and I can't find a way to hide a task from the setup interface.
Is there a way to hide this task? Or another, better way to solve this problem?
There is no natural difference between running the setup from the "interface" (presumably Explorer?) and running from a command prompt.
Maybe you mean /silent? If so, use the WizardSilent() function.
If you don't want it to be silent, you can pass your own /skipXYZ parameter that you then check using GetCmdTail() or {param:...}
Related
I need to run a shell script that should interact with couple of servers / routers in daily schedule. The script will simply login to the remote end, run a command. Up to here i hear that you are saying it is easy. The real problem here is that i need to analyze the output of the first command and based on the output i need to organize the second command. This is also doable, but the situation here is that i do not want to login and logout from the box for every command.
What i need is to login once, stay alive ,run the command take the output, analyze it and then run the second command later on logout and close connection.
Correct me if i am wrong but expect is not an option here. I want to ask for your suggestions.
Which language / module of this language i can use to complete this requirement.
Environment is not pure ssh, so i should have something general that can be used for both ssh/telnet.
Thanks in advance
Since you mentioned python, pexpect should do the job pretty well:
https://pexpect.readthedocs.org/en/latest/overview.html
Suppose I have a couple of commands in Alloy, including run and check commands. When I push the Execute button in the IDE, it only executes the first one and ignores the rest.
Is there any way to force Alloy run all the commands in the code one after another?
You can chose Execute -> Execute All from the main menu.
I have a load test project that I run regularly from the Visual Studio using the Load Test GUI. I would like to run that test from the command line by changing its parameters such as the number of users, run duration etc.
In visual studio load test, there are usually 3 type of settings that I usually play around.
Test setting: for general controller and agent assignments.
Run settings: in which I set the run duration, where to save the logs of the test results etc.
Scenario settings: used to set the load pattern and test mix etc.
Ideally I should be able to change any of these settings using some command line parameters of MSTEST utility or assigning a setting file for each goal, however I haven't been able to accomplish that setting change using the MSTEST command line options. I am able to run the load test using the state where I left off before exiting the GUI, however I cannot set the runsetting that is not currently active or I cannot change the user load defined in the scenario settings.
For my current task, being able to change the user load from the command line is more urgent than changing other parameters. So if someone knows how to change Scenario Settings from the command line that would be great help. I already tried creating more than one scenario with different number of users however in Visual Studio, seems like it is not possible to select particular scenario and execute test using it. Once the load test starts, it runs every available scenarios sequentially. So I think for my purpose I should create only one scenario and be able to change the user load from command line somehow.
Thanks for the help in advance.
As far as I know, none of those items are available as command line options or similar. But all, or possible just most, are available programmatically via a load test plugin. One possible solution for you is to set the required values in the LoadTestStarting event. The values could be read from a file or from environment variables; you choose what values are available and how to represent them.
This Microsoft blog introduces load test plugins and has several examples.
This is the MSDN doc on how to set test settings you want active from command line with MSTest.
https://msdn.microsoft.com/en-us/library/ff426021.aspx
Unfortunately, I haven't been able to find a way to change the step load pattern (and user count within).
I have a program that needs to start another program. On my mac I did this using system("open path"), but on linux that doesn't work. and using system(./path) is not what I want since than it overtakes the running program.
So is there any way to get the same behaviour as the mac 'open path' command on linux?
(linux noob btw:p)
If you're running the application in a GUI environment, this should be possible but the approach is different. You need to start a new terminal instance explicitly.
Determine the path to your terminal application. This depends on the linux distribution.
Next, check the documentation of that particular terminal application and find out how it can be started to run an application (your application) instead of a shell. This probably involves using some application-specific command line options. Test that in a terminal window, until you have a command line that gives you the desired result. Things could get a little tricky if your application needs command line arguments as well. Use the -- option where necessary.
Then, all you need to do is run that command line from your "parent" application. I would advise however to not use system(). The exec... family functions (using fork and wait) provide better control.
I'm looking for a method to check from within my shell script that script specific completion have been initialized by user using complete -F ...
I want this check to print out an advice on how to initialize the completion like:
Warning: Auto completion is not initialized. Please run : source ....; complete -F ...
The problem is that the script,being run in a sub-shell has no information about "complete" environment of the parent shell where user is working.
So complete -p| grep my-script-name never return any result.
User is expected to run "source" and "complete" commands or add them into his .bashrc manually, because we're working on a server where we have no access to the bash completion system directory.
Alternatively if you know a method of initializing(and not only checking) the auto-complete from within the script, I would happily accept it.
The only way your script can have access to such information for the parent shell is if it is included instead of executed as a sub-shell. Rather than instructing your users they can include some configuration, you can design your script so it works whether it is run or included.
Then you can simply inform your users that if they want completion enabled they need to include your script rather than run it as an executable script (with instuctions to use source or . as you wish).
However, in this case, I would be inclined to either add this information in documentation or add it into a banner which is always displayed (but can be disabled with an option switch like -q), rather than support two modes of running the script (since the gain is so small).
Either you want every user to use bash completion (which I don't think is good, for example I prefer to have it turned off), or let users decide themselves, but having them this message printed out on each TABTAB is a threat, don't you think?
I'd put into /etc/bash.bashrc what you think every user should run.