scripting

Embedding in the Powershell script issue

一笑奈何 提交于 2020-01-04 12:46:55
问题 Creating this question based on the advice of another users advice, it is a follow-up of this. The scenario is that I am currently trying to create a Powershell script, that a first-time user can run, which will install a bunch of programs and complete several configuration changes. One of the configuration changes is to create a file which has two shell commands (posted below), which will then be executed everytime GitBash is loaded. The commands I'm trying to input into the .sh file are..

Scripting PDF Creation

孤街浪徒 提交于 2020-01-04 06:37:30
问题 I've been tasked with automating the collection of some reports from our remote locations. The machines are sometimes used locally by the staff at the location, and their usage is random. The software that generates the reports is somewhat limited and just allows us to print to the default printer. The department that's taking these reports doesn't want anything to change, and they enjoy getting their PDFs. I can programmatically change the default printer to use the PDFCreator printer (and

Do you prefer compiled or scripted languages? [closed]

限于喜欢 提交于 2020-01-04 06:23:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago . Since this is wide community using all kind of different technologies, it seems like appropriate place to ask this. Do you like to

how do you get window ID for xdotool automatically

﹥>﹥吖頭↗ 提交于 2020-01-04 04:30:27
问题 I am trying to automate testing forms that selenium would take too long (javascript heavy modern forms), and I want to use xdotool and get window IDs. I see you can call xdotool selectwindow and click it, but then you have to click it each time. I want to tell it "for google chrome windows where the tab title is x, do y" I got the window ID here: cchilders@cchilders-Dell-Precision-M3800:~$ xdotool selectwindow 65011713 This is for chrome itself, each tab gets the same value when clicked. So I

exclude directory clang format

跟風遠走 提交于 2020-01-04 02:53:08
问题 Is there any official directive in .clang-format file to exclude directory for applying? Projects sometimes use git submodule , but it is not useful to run clang-format over all directory and then use git checkout to undo changes in submodule folder. I have found some related links: Mozilla Source Github Repo But they don't seem official. 回答1: So far, I don't know of any option of clang-format to exclude files or directories. But what I do, is to create the list of files I want to process in

Import-CSV GroupBy Sum

爷,独闯天下 提交于 2020-01-04 02:38:11
问题 I am stuck trying to get meaningful output from a csv file. The raw input looks like this. Col1,Col2,Col3,Col4 a,2,b,z a,2,c,x a,1,d,y e,1,f,s e,2,g,t h,1,k,r I am trying to achieve an output of below (exclude col4) and export to a file for further reporting using PowerShell 2. a 5 b,c,d e 3 f,g h 1 k Code from my script function is: $data = import-csv $filename.csv | Select-Object -property Col1,Col2,Col3 $view | Group Col1 | ` select Name,@{ Name="Col2Sum"; Expression = { [math]::round(($_

How to save entire output of bash script to file

て烟熏妆下的殇ゞ 提交于 2020-01-04 02:18:25
问题 I am trying to get the entire output of a bash script to save to a file. I currently have one argument (ip address) at the beginning of the code looks like this: #!/bin/bash USAGE="Usage: $0 [<IP address>]" if [ "$#" == "0" ]; then echo "$USAGE" exit 1 fi ip_addr=$1 What I'd like to do is add another argument called "output", that the entire output of the script will save to. I'm aware I could just run myscript.sh | tee textfile.txt , but I'd like to make the script a little easier to run for

composing multiple mysql scripts

六月ゝ 毕业季﹏ 提交于 2020-01-04 02:11:29
问题 Is it possible to INCLUDE other mysql scripts in a composite script? Ideally I do not want to create a stored procedure for the included scripts... For larger projects I would like to maintain several smaller scripts hierarchically and then compose them as required... But for now, I'd be happy to just learn how to include other scripts... 回答1: source is a builtin command you can use in the MySQL client tool (which is what you're using to execute the SQL script): mysql> source otherfile.sql If

Why does multiplication does not work with Read-Host value

主宰稳场 提交于 2020-01-03 19:06:54
问题 $table_num = Read-Host -Prompt 'Enter the table number you want to get printed' for ($i=1; $i-lt 11; $i++){ $ans = ($table_num*$i) write "$table_num*$i=$ans" } Above is the script which I was trying to execute and I get the result as below: Enter the table number you want to get printed: 5 5*1=5 5*2=55 5*3=555 5*4=5555 5*5=55555 5*6=555555 5*7=5555555 5*8=55555555 5*9=555555555 5*10=5555555555 I am new to scripting and help me with my code. 回答1: As you did not point out what is the expected

SQL Server parallels to Oracle DBMS_METADATA.GET_DDL?

橙三吉。 提交于 2020-01-03 17:12:19
问题 I'm looking for command line or scripted solutions to pull the DDL out of SQL Server 2005+ for all database objects: tables, stored procs, views, indices/indexes, constraints, etc. GUI tools are not of interest. Preference is for built-in tools, since that would be the most comparable to Oracle's DBMS_METADATA stuff. Also, preference for a solution that is as simple as Oracle's for getting the DDL out - eg, a one liner: SELECT DBMS_METADATA.GET_DDL('TABLE', 'MY_TABLE') FROM DUAL Note: Getting