shell - How to extract the values in tick separated by comma between the bracket of "PARTITIONED BY" clause

I have shell script which extracts the syntax of the create table statement for all tables in a database. I loop one create table statement at a time and create table statement will be available as a variable $DATA within the loop. I need to extract the columns in the create table statements within the partitioned by clause. For example, $DATA is the variable within the loopInput of Iteration 1 to the loop:DATA="CREATE TABLE `xxx`( `path` varchar(200), `fsize` bigint, `usrname` varchar(100)) PARTITIONED BY ( `depth` int, `permi` varchar(100)) R...Read more

shell - Divide each row by max value in awk

I am trying to divide the rows by the max value in that row as (with rows having all columns as NA) r1 r2 r3 r4a 0 2.3 1.2 0.1b 0.1 4.5 9.1 3.1c 9.1 8.4 0 5I get r1 r2 r3 r4a 0 1 0.52173913 0.043478261b 0.010989011 0.494505495 1 0.340659341c 1 0.923076923 0 0.549450549I tried to calculate max of each row by executing awk '{m=$1;for(i=1;i<=NF;i++)if($i>m)m=$i;print m}' file.txt > max.txtthen pasted it as the last column to the file.txt as paste file.txt max.txt > file1.txtI am trying to execut...Read more

lisp - Shell Script to generate word list with non repeating characters

I found a lisp program. It works, but not exactly how I need it too. It outputs like this:2323232323235ve32323232323235ve42323232323235ve52323232323235ve6I need to make a word list, with words that are 16 characters long using Base32 characters, with non repeating characters in the word.Then I need to add .txt to the word.asdfjklwert7csui.txtjcfklinesftw8se3.txtThen I need to SHA512 the word and check against a known hash.Would it be possible just to output the word that matches the known hash?Here is the LISP source#!/usr/bin/clisp(defparamete...Read more

shell - Parametric gnuplot Scripts

When I try to write a shell script such asgnuplotcd '/home/cagirici/test'plot "case1.test" with linespointsand run it in sudo, the script stops after running gnuplot.In each .test file, I have 12 columns. I won't plot them all at once but choose what to plot. For instance, if I choose to plot the success percentage, it should plot 1:2 and 1:8. But if I choose error percentage, it should plot 1:4 and 1:10 (it is basically i:(i+6).)I need to write a scripts that takes two inputs: i) file name ii) what to plot.Notice that I also want to choose the...Read more

shell - GhostScript: Bug under High Sierra setting PDF Metadata?

Can anyone confirm the following behaviour on MacOS 10.13 High Sierra with GhostScript? I don't get the problem when using 10.12 Sierra.When I create PDFs in GhostScript, it always leaves the Title, Author and other metadata blank.I know that you can set the metadata with PDFmarks within the PostScript file itself (or a secondary merged PS file that just contains PDFmarks), but that requires manually setting the field for each file.Currently, my PDFs fail PDF-X validation until I manually add the metadata.My PostScript does contain DSC comments...Read more

shell - Get echoed cron text sent to email

I have 2 digital clean servers - one is a few years old, one is new.On the old server, any cron jobs that run with an echo, the echoed content is emailed to me. I'm pretty sure this happened by default - I didn't configure this myself.On the new server, echoed content is not emailed. I have tried to send an email using the following, which worked fine, so my understanding is that email is running ok.echo "This is the body of the email" | mail -s "This is the subject line" "me@myemail.com"Can anyone tell me if there's a specific option for this,...Read more

ubuntu - Lxterminal open several tabs from shell script

Im trying to open several tabs in a shell script. In gnome-terminal it looks like that:gnome-terminal \--tab -e "bash -ic \" echo 'First tab' "; exec bash\"" \--tab -e "bash -ic \"echo 'Second tab' "; exec bash\"" Im trying to do in lxterminal but it doesnt work :(lxterminal \--tabs -e "bash -ic \" echo 'First tab'; exec bash\"" \--tabs -e "bash -ic \" echo 'Second tab'; exec bash\"" \in a help file I see:Usage: lxterminal [Options...] - LXTerminal is a terminal emulatorOptions: -e, --command=STRING Execute the argument to this ...Read more

shell - start WebLogic from Jenkins

I want to stop and start WebLogic from Jenkins. If I start by shell script in Jenkins:./startWebLogic.sh the process is not finished, but WebLogic is started.If I start by shell script with nohup in Jenkins:. ./setWLSEnv.shnohup ./startWebLogic.sh > /dev/null &the process is finished, but WebLogic is not started.I tried the same script on the same server from putty, in result process is finished and WebLogic is started.How I can start WebLogic and execute other shell script from Jenkins....Read more

shell - `find -name` pattern that matches multiple patterns

I was trying to get a list of all python and html files in a directory with the command find Documents -name "*.{py,html}".Then along came the man page: Braces within the pattern (‘{}’) are not considered to be special (that is, find . -name 'foo{1,2}' matches a file named foo{1,2}, not the files foo1 and foo2.As this is part of a pipe-chain, I'd like to be able to specify which extensions it matches at runtime (no hardcoding). If find just can't do it, a perl one-liner (or similar) would be fine.Edit: The answer I eventually came up with inc...Read more

Calling Shell-methods by chain of files in subdirectories

I'm trying to call methods from file to file with structure like:/root /subDir /subSubDir inSubSub.sh inSub.sh inRoot.shFiles contents:inRoot.sh:#!/bin/bashsource ./subDir/inSub.shsubMethod;inSub.sh:#!/bin/bashsource ./subSubDir/inSubSub.shsubMethod () { echo "I'm in sub"}subSubMethod;inSubSub.sh:#!/bin/bashsubSubMethod () { echo "I'm in subSub"}subSubMethod;Result of running $ ./inRoot.shsubDir/inSub.sh: line 2: subSubDir/inSubSub.sh: No such file or directorysubDir/inSub.sh: line 6: subSubMethod: command not ...Read more