output

Windows Batch to read file and parse lines into tokens and variables

狂风中的少年 提交于 2019-12-06 02:30:57
问题 I've made a good deal of headway by searching this site and learning the ridiculous language that is Windows batch scripting, but I'm now at a point where I'm stuck. I have a text file with a variable number of lines, each of which looks something like: AA8315,"United States",N777AN,"American Airlines",AAL98,B772,"Boeing 777-223",AAL,"2013-06-11 23:30:47.923","2013-06-12 00:01:14.459" My batch file: set THEDATE=2013-06-12 set THEDATABASE=c:\Kinetic\BaseStation\Basestation.sqb set THECSVFILE=c

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_

logstash output to file and ignores codec

醉酒当歌 提交于 2019-12-06 02:24:00
问题 could please someone explain to me, why logstash keeps ignoring "codec => plain => format" setting, I am trying to set? Cfg file I am using: input { gelf { host => "[some ip]" port => 12201 } } output { elasticsearch { host => "[some ip]" bind_port => "9301" } file { codec => plain { format => "%{[time]} | %{[severity]} : /%{[thread]}/ %{[loggername]} (%{[sourcemethodname]}) - %{[message]}" } path => "/Users/[some user]/logs/%{host}/%{facility}-%{+YYYY-MM-dd}.log" } } I thought I used the

Ansible output formatting options

安稳与你 提交于 2019-12-06 01:33:15
Is there an option to format ansible output with the use of ansible (not any other scripts)? For instance name: Show version sudo: true hosts: web_front_end tasks: - name: Create yum cache shell: yum makecache - name: Check the version of Portal shell: rpm -qa | grep portal register: portal - debug: msg={{portal.stdout}} tags: - portal - wfe I would like to get only the TASK: [debug msg={{portal.stdout}}] part. Or even is there a way to get only the shell command output? I have a plugin to format the output. The gist is here but the gist's gist is: # Save as <folder with your playbook>

Amazon + Django each 12 hours appears that [Errno 5] Input/output error

ⅰ亾dé卋堺 提交于 2019-12-05 23:15:21
问题 I recently setup and deploy an Amazon EC2 instance for deploy my django project. I was interacting with my application via browser when I get this error in the browser: errno 5 input/output error django This error did reference to some function of my application Environment: Request Method: GET Request URL: http://localhost:8000/accounts/profile/ Django Version: 1.9 Python Version: 3.4.3 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',

Creating nice looking output

北城以北 提交于 2019-12-05 22:12:53
I've been working on quite an ambitious function, which I hope can be used by people other than me once I am finished. When it's just me using the function I can live with the output being kind of lame, but what if I want some nice looking output? What I'm looking for is essentially this: A way of printing something readable to the console Being able to access what's printed More specifically, let's assume I have three scalar objects I want to be printed: stat , dfree and pval . Currently, the way I do it is: result <- list(statistic = stat, degrees = dfree, p.value = pval) return(result) That

How to understand the output of command 'gradle dependencies'?

纵然是瞬间 提交于 2019-12-05 20:22:40
问题 There is part of the output: output of gradle dependencies What does the symbols ('+','\','->','()','(*)') exactly mean? 回答1: + , - , | and \ are just used to draw the tree - it's a kind of ASCII art. When it comes to (*) and -> please refer to this question and answer. tl;dr (*) - is used to indicate that particular dependency is described somewhere else in the tree -> - is used to point the dependency that wins in version conflict. 来源: https://stackoverflow.com/questions/39136789/how-to

Python console application - output above input line

微笑、不失礼 提交于 2019-12-05 20:03:01
问题 I am trying to write a console application in Python3. The problem is I would like all output messages EG: print("Status message") to be above the input line at the bottom. Status message 1 Status message 2 Status message 3 Console:> I want to type here while the output messages displayed at the moment it looks more like this Console:> want to type here while the outStatus message 1 put messages displayed Is there anyway to do this without using curses? 回答1: Try this: print chr(27)+'[2AOutput

Remove blank lines in powershell output

喜夏-厌秋 提交于 2019-12-05 19:52:22
问题 I'm trying to remove blank lines before and after output but it's just not working. I tried Adding -NoNewLine after the very first Write-Host, but that only removes one blank line so far. Code: $tag1 = "c91638" Write-Host "Operating System Information" $OSInfo = get-wmiobject -class win32_operatingsystem -computername $tag1 $OSInfo ` | Format-List ` @{Name="OS Name";Expression={$_.Caption}}, @{Name="OS Boot Time";Expression={$_.ConvertToDateTime($_.LastBootUpTime)}}, @{Name="OS Install Date"

Formatting output with printf: truncating or padding

纵饮孤独 提交于 2019-12-05 18:47:17
I would like to produce the following output: > Avril Stewart 99 54 > Sally Kinghorn 170 60 > John Young 195 120 > Yutte Schim... 250 40 As you can see, names shorter than 14 characters are padded with spaces. Names longer than 15 characters are truncated: 'Yutte Schimmelpenninck' truncates to 'Yutte Schim...'. Here is what I have tried to achieve this (the variables $name , $height , and $weight are extracted from files, and a loop runs the printf command on each file data): printf '%-14s -%3s -%3s\n' "$name" "$height" "$weight" > Avril Stewart 99 54 > Sally Kinghorn 170 60 > John Young 195