scripting

Execute several programs at the same time in an initialisation/bash script

╄→尐↘猪︶ㄣ 提交于 2020-01-03 17:00:11
问题 Hello I am working with a simulator that uses rcS scripts to boot, this is my script cd /tests ./test1 & ./test2 & ./test3 & ./test4 exit What I want is run all the test at the same time and that the exit command is executed only when all the previous test have finished. And not only when test 4 has finished, is this possible?. Thank you. 回答1: You can use wait: ./test1 & ./test2 & ./test3 & ./test4 & wait From the bash man page: wait [n ...] Wait for each specified process and return its

Execute several programs at the same time in an initialisation/bash script

♀尐吖头ヾ 提交于 2020-01-03 16:58:46
问题 Hello I am working with a simulator that uses rcS scripts to boot, this is my script cd /tests ./test1 & ./test2 & ./test3 & ./test4 exit What I want is run all the test at the same time and that the exit command is executed only when all the previous test have finished. And not only when test 4 has finished, is this possible?. Thank you. 回答1: You can use wait: ./test1 & ./test2 & ./test3 & ./test4 & wait From the bash man page: wait [n ...] Wait for each specified process and return its

PowerPoint VBA: which command (or a set of commands) would create ppt frames out of my .jpg pictures?

允我心安 提交于 2020-01-03 16:49:20
问题 I have a few .jpg files in C:\my_folder Here are their names: pic_1.jpg , pic_2.jpg , pic_3.jpg , pic_4.jpg , pic_5.jpg . What command or a group of commands in Power Point VBA should I use in order to be able to automatically create several frames in PowerPoint so that each frame would contain one picture? 回答1: This VBScript creates a new PowerPoint presentation and adds two slides to it, each with a picture. You will need to adjust the picture's location and size to suit your taste. Also

Copying files with wildcard (*) to a folder in a bash script - why isn't it working?

柔情痞子 提交于 2020-01-03 06:50:37
问题 I am writing a bash script that creates a folder, and copies files to that folder. It works from the command line, but not from my script. What is wrong here? #! /bin/sh DIR_NAME=files ROOT=.. FOOD_DIR=food FRUITS_DIR=fruits rm -rf $DIR_NAME mkdir $DIR_NAME chmod 755 $DIR_NAME cp $ROOT/$FOOD_DIR/"*" $DIR_NAME/ I get: cp: cannot stat `../food/fruits/*': No such file or directory 回答1: You got that exactly backwards -- everything except the * character should be double-quoted: #!/bin/sh dir_name

What does 1>&2 mean in shell? [duplicate]

爱⌒轻易说出口 提交于 2020-01-03 06:42:12
问题 This question already has answers here : echo that outputs to stderr (14 answers) In the shell, what does “ 2>&1 ” mean? (15 answers) Closed 5 years ago . Pretty noob question, what does the 1>&2 do in this script? if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" 1>&2 exit 1 fi 回答1: That redirects the line "This script must be run as root" from standard out (STDOUT) to standard error output (STDERR). It's a easy way to print an error message to STDERR - this matters if

Python - Change the textField after browsing - MAYA

ぃ、小莉子 提交于 2020-01-03 05:47:35
问题 I've got the most annoying problem with my GUI Exporter in Maya. I've made the textField etc. work, but I can't change the value of the textField after it's created, which is what I need to do. What I want to do for example is, let's say the filepath is none from the beginning. The textField has now printed out: "None" in it, but after you press browse and select a directory, I want it to change None to the directory path etc. That's the only problem I currently have and the error code

Roblox making functions run more than once

我的未来我决定 提交于 2020-01-03 05:45:27
问题 My code: local UIS = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local Activation = Instance.new("Sound",game.Players.LocalPlayer.Character.Head) local char = Player.Character local hum = char.Humanoid local root = char.HumanoidRootPart UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://1581972610" local animTrack = hum

How do I indirectly assign a variable in bash to take multi-line data from both Standard In, a File, and the output of execution

↘锁芯ラ 提交于 2020-01-03 04:43:27
问题 I have found many snippets here and in other places that answer parts of this question. I have even managed to do this in many steps in an inefficient manner. If it is possible, I would really like to find single lines of execution that will perform this task , rather than having to assign to a variable and copy it a few times to perform the task. e.g. executeToVar () { # Takes Arg1: NAME OF VARIABLE TO STORE IN # All Remaining Arguments Are Executed local STORE_INvar="${1}" ; shift eval $

Maya Python Create and Use Zipped Package?

≡放荡痞女 提交于 2020-01-03 04:19:04
问题 Can anyone describe exactly how someone can create and execute a python zip package in Maya? A lot of tutorials and questions regarding this jump into the middle and assume certain knowledge. I need a simple example as a starting point. Folder/ scriptA.py scriptB.py scriptC.py ScriptA: Import ScriptB Import ScriptC Create zip of Folder In Maya Code to run Folder as if not zipped ScriptA.foo() In folder we have three scripts. ScriptA references the other two. I zip the folder with a program

Parse comma separated string of numbers into variables (scripting) bash [duplicate]

99封情书 提交于 2020-01-03 03:00:52
问题 This question already has answers here : How do I split a string on a delimiter in Bash? (32 answers) Closed last year . The post marked as duplicate above is similar, however is not sufficient for the use case. The below answers show a minimalist use of the read command to put parsed input for a known length of delimiter separated values into helpfully-named variables. For instance, if I read all four vars into $STATEMENTS,$BRANCHES,$FUNCTIONS,$LINES - a loop is not ideal as it adds a