non-interactive

How to get an Rscript to return a status code in non-interactive bash mode

谁都会走 提交于 2020-12-15 06:17:12
问题 I am trying to get the status code out of an Rscript run in an non-interactive way in the form of a bash script. This step is part of larger data processing cycle that involves db2 scripts among other things. So I have the following contents in a script sample.sh: Rscript --verbose --no-restore --no-save /home/R/scripts/sample.r >> sample.rout when this sample.sh is run it always returns a status code of 0, irrespective of if the sample.r script run fully or error out in an intermediate step.

Gatttool non-interactive mode --char-write

风格不统一 提交于 2020-01-05 03:07:27
问题 Still asking about BLE devices and gatttool . I'm able to send a char-write-cmd in interactive mode, but I'm not able to do the same in non-interactive. This is what I send in interactive mode : gatttool -I []> connect BTADDR [BTADDR]> char-write-cmd 0x0040 01 [BTADDR]> exit In this way I start the Alert service, which in my case makes the buzzer sounds. In theory, the non-interactive mode should be: gatttool -b BTADDR --char-write -a 0x0040 -n 01 But this do not send the request command

Simple c++ program fails to run as a scheduled-task (interactive/non-interactive issue?)

南楼画角 提交于 2019-12-24 09:35:39
问题 I'm running Win 7 x64 and I've written a very simple c++ program with Microsoft Visual c++ 2010 express, to be run as a task in task scheduler. this is the programs code (there's no resource files or header files): #include <windows.h> int WINAPI WinMain(HINSTANCE inst,HINSTANCE prev,LPSTR cmd,int show) { // Simulate numlock key press keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 ); // Simulate numlock key release keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF

Is it possible to run WSL Bash in non-interactive mode?

混江龙づ霸主 提交于 2019-12-23 04:33:34
问题 One may want to use Bash on Windows in Task Scheduler or maybe as version-control hook scripts. Is it possible or supported? If not, why? Is it a bug or a measure to prevent some issues? 回答1: If I'm understanding your question correctly, the -c option is what you're looking for. It allows you to directly invoke a Linux command. For example, to open the man page for bash (perhaps in order to find out about the -c option): bash -c "man bash" Note: You can leave off the quotes if you escape any

Passing arguments to an interactive program non-interactively

痞子三分冷 提交于 2019-12-16 19:58:11
问题 I have a bash script that employs the read command to read arguments to commands interactively, for example yes/no options. Is there a way to call this script in a non-interactive script passing default option values as arguments? It's not just one option that I have to pass to the interactive script. 回答1: For more complex tasks there is expect ( http://en.wikipedia.org/wiki/Expect ). It basically simulates a user, you can code a script how to react to specific program outputs and related

bash seems to ignore BASH_ENV when accessed through a symlink

瘦欲@ 提交于 2019-12-12 09:06:55
问题 I'm working in a UNIX environment where /bin has been set up like this: -rwxr-xr-x 1 root root 617144 Nov 19 2009 bash lrwxrwxrwx 1 root root 4 Nov 23 2010 sh -> bash In my environment I have set $BASH_ENV to point to my local .bashrc: env | grep BASH BASH_ENV=/home/users/atomicpirate/.bashrc In addition, .bashrc has as its first line echo BASHRC READ . I would expect /bin/sh and /bin/bash to behave exactly the same with this setup...but they don't: /bin/bash -c 'echo $BASH_ENV' BASHRC READ

How do I show the results of pattern-matching goals with several free variables in SWI-Prolog from a shell invocation?

强颜欢笑 提交于 2019-12-06 08:31:25
问题 Let's use the following prolog base : father(anakinSkywalker, princessLeia). father(anakinSkywalker, lukeSkywalker). saysOhNo(lukeSkywalker). sdesciencelover asked how to show the results of pattern-matching goals in swi-prolog from a shell invocation, and got an answer giving a manual transformation on the query, to isue a write. swipl -q -s kb.pl -t "father(anakinSkywalker,X), writeln(X), false" Result: princessLeia lukeSkywalker This works fine when one only has a few queries with a single

bash storing the output of set -x to log file

帅比萌擦擦* 提交于 2019-12-06 02:26:01
问题 I have a simple download script and I use set -x which works great; I can see each step it performs, and I can identify errors in the script or in the download: #!/bin/bash set -x #short_date=$(/bin/date +%m%d%y) short_date=$(/bin/date -d "8 day ago" +%m%d%y) #long_date=$(/bin/date +%Y%m%d) long_date=$(/bin/date -d "8 day ago" +%Y%m%d) scp -v -P 1332 -i /home/casper/.ssh/id_rsa_BANK friendly@192.168.1.10:/home/friendly/transfer/out/EXCHANGE_$short_date.csv /local/casper3/dailymetrics/BANK_

avoiding browser calls in R

左心房为你撑大大i 提交于 2019-12-04 21:40:40
问题 I have an elaborate script that spans multiple functions (and files). For debugging purposes I need to embed browser calls into all sorts of nooks and crannies. When I presumably fix something, I want to run the whole thing without debugging, ergo avoiding browser calls because commenting out all browser calls would mean a considerable effort from my part. @mdsumner on R chat suggested running the script in non-interactive mode (i.e. using Rscript.exe on Windows) but I would benefit from

How do I show the results of pattern-matching goals with several free variables in SWI-Prolog from a shell invocation?

假如想象 提交于 2019-12-04 16:18:12
Let's use the following prolog base : father(anakinSkywalker, princessLeia). father(anakinSkywalker, lukeSkywalker). saysOhNo(lukeSkywalker). sdesciencelover asked how to show the results of pattern-matching goals in swi-prolog from a shell invocation, and got an answer giving a manual transformation on the query, to isue a write. swipl -q -s kb.pl -t "father(anakinSkywalker,X), writeln(X), false" Result: princessLeia lukeSkywalker This works fine when one only has a few queries with a single free variable, but manually transforming each one becomes tedious, and if we want proper output with