cut

Bash script builds correct $cmd but fails to execute complex stream

萝らか妹 提交于 2020-01-05 09:34:56
问题 This short script scrapes some log files daily to create a simple extract. It works from the command line and when I echo the $cmd and copy/paste, it also works. But it will breaks when I try to execute from the script itself. I know this is a nightmare of patterns that I could probably improve, but am I missing something simple to just execute this correctly? #!/bin/bash priorday=$(date --date yesterday +"%Y-%m-%d") outputfile="/home/CCHCS/da14/$priorday""_PROD_message_processing_times.txt"

Bash script builds correct $cmd but fails to execute complex stream

一个人想着一个人 提交于 2020-01-05 09:34:32
问题 This short script scrapes some log files daily to create a simple extract. It works from the command line and when I echo the $cmd and copy/paste, it also works. But it will breaks when I try to execute from the script itself. I know this is a nightmare of patterns that I could probably improve, but am I missing something simple to just execute this correctly? #!/bin/bash priorday=$(date --date yesterday +"%Y-%m-%d") outputfile="/home/CCHCS/da14/$priorday""_PROD_message_processing_times.txt"

Bash script builds correct $cmd but fails to execute complex stream

眉间皱痕 提交于 2020-01-05 09:34:10
问题 This short script scrapes some log files daily to create a simple extract. It works from the command line and when I echo the $cmd and copy/paste, it also works. But it will breaks when I try to execute from the script itself. I know this is a nightmare of patterns that I could probably improve, but am I missing something simple to just execute this correctly? #!/bin/bash priorday=$(date --date yesterday +"%Y-%m-%d") outputfile="/home/CCHCS/da14/$priorday""_PROD_message_processing_times.txt"

Cut Function in R program

徘徊边缘 提交于 2020-01-03 04:59:06
问题 Time Velocity 0 0 1.5 1.21 3 1.26 4.5 1.31 6 1.36 7.5 1.41 9 1.46 10.5 1.51 12 1.56 13 1.61 14 1.66 15 1.71 16 1.76 17 1.81 18 1.86 19 1.91 20 1.96 21 2.01 22.5 2.06 24 2.11 25.5 2.16 27 2.21 28.5 2.26 30 2.31 31.5 2.36 33 2.41 34.5 2.4223 36 2.4323 So I have data about Time and Velocity...I want to use the cut or the which function to separate my data into 6 min intervals...my Maximum Time usually goes up to 3000 mins So I would want the output to be similar to this... Time Velocity 0 0 1.5

Using cut in bash on a file with a unique deliminter

十年热恋 提交于 2020-01-01 12:32:07
问题 Can cut be used in bash with the ¬ delimiter? This question is an extension of the topic covered here. One interpretation of the goal in that link is to use a delimiter that can not be found (or very rarely found) in human text. Say we choose the 'Not Sign' ( ¬ ) as a delimiter. My question is regarding the use of cut to pull specific columns of a file with said delimiter. For example, say that we create a file with the ¬ delimiter. The file prac.txt might look like: $cat prac.txt "Billy""Car

Get the value of a textbox during cut event

夙愿已清 提交于 2019-12-30 18:41:50
问题 I have trapped the cut event (jquery) on a textbox. What I want is to get the text on the textbox during the cut event is triggered. I've tried accessing the data the user cut via evt.originalEvent.clipboardData.getData('text') but returns undefined. My goal is to know if the user cut all the text (textbox is now empty) or not. Thanks in advance 回答1: You can setTimeout with a duration of 0, which schedules a function for immediate execution. The nice thing is that the function will execute

tail -f into grep into cut not working properly

时间秒杀一切 提交于 2019-12-29 06:40:07
问题 i'm trying to build a shell script to monitor some log files. I'm using a command like this: tail -f /var/somelog | grep --line-buffered " some test and p l a c e h o l d e r" | cut -f 3,4,14 -d " " the log file is like: some test and p l a c e h o l d e r 3 some test and p l a c e h o l d e r 4 some test and p l a c e h o l d e r 5 some test and p l a c e h o l d e r 6 and so on.. My issue is that the output of the command does not display the last line some test and p l a c e h o l d e r 6

tail -f into grep into cut not working properly

南笙酒味 提交于 2019-12-29 06:39:08
问题 i'm trying to build a shell script to monitor some log files. I'm using a command like this: tail -f /var/somelog | grep --line-buffered " some test and p l a c e h o l d e r" | cut -f 3,4,14 -d " " the log file is like: some test and p l a c e h o l d e r 3 some test and p l a c e h o l d e r 4 some test and p l a c e h o l d e r 5 some test and p l a c e h o l d e r 6 and so on.. My issue is that the output of the command does not display the last line some test and p l a c e h o l d e r 6

Get java version number from python

≯℡__Kan透↙ 提交于 2019-12-28 18:25:02
问题 I need to get the java version number, for example "1.5", from python (or bash). I would use: os.system('java -version 2>&1 | grep "java version" | cut -d "\\\"" -f 2') But that returns 1.5.0_30 It needs to be compatible if the number changes to "1.10" for example. I would like to use cut or grep or even sed. It should be in one line. 回答1: Considering an output like this: $ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit

Get java version number from python

时间秒杀一切 提交于 2019-12-28 18:24:44
问题 I need to get the java version number, for example "1.5", from python (or bash). I would use: os.system('java -version 2>&1 | grep "java version" | cut -d "\\\"" -f 2') But that returns 1.5.0_30 It needs to be compatible if the number changes to "1.10" for example. I would like to use cut or grep or even sed. It should be in one line. 回答1: Considering an output like this: $ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit