shell

maven zip uber-jar and shell script

冷暖自知 提交于 2021-02-08 06:21:15
问题 I would like maven to combine an uber-jar created by the shade-plugin and a shell script from the all_files directory. The project structure looks like this: all_files/ mvn_script.sh projB-shaded.jar maven_project/ guide/ parent-pom.xml projA/ pom.xml projB/ pom.xml The jar is produced by projectB's pom file and then placed into the outtermost folder to be ready to be zipped with the shell script. The reason is so that the shell script can call the jar file to execute the project. I want

AWK (unexpected newline or end of string)

心不动则不痛 提交于 2021-02-08 04:57:26
问题 I'm trying to execute bash script but I'm got stuck. data $ cat test.txt cat,command,for cp,command,for ls,command,to script #!/bin/bash CUT_FILE=test.txt TRN_GUID="1bcd1adf-2016-443b-9f00-2e4ce20726d7" LCTN_ID="8002" LCTN_NAME="TEST FILE" LCTN_ADDR1="This is test" cat $CUT_FILE | awk -F ',' '{ print '$TRN_GUID','$LCTN_ID','$LCTN_NAME','$LCTN_ADDR1',$1,$2 }' output -bash-3.2# sh test4 awk: cmd. line:1: { print 1bcd1adf-2016-443b-9f00-2e4ce20726d7,8002,TEST awk: cmd. line:1: ^ unexpected

HDFS Command Line Append

人盡茶涼 提交于 2021-02-08 03:41:53
问题 Is there any way to append to a file on HDFS from command line like copying file: hadoop fs -copyFromLocal <localsrc> URI 回答1: This feature is implemented in Hadoop 2.3.0 as appendToFile with a syntax like: hdfs dfs -appendToFile localfile /user/hadoop/hadoopfile (it was first suggested in 2009 when the HDFS Append feature was being contemplated: https://issues.apache.org/jira/browse/HADOOP-6239 ) 回答2: cli doesn't support append, but httpfs and fuse both has support for appending files. w301%

HDFS Command Line Append

巧了我就是萌 提交于 2021-02-08 03:41:15
问题 Is there any way to append to a file on HDFS from command line like copying file: hadoop fs -copyFromLocal <localsrc> URI 回答1: This feature is implemented in Hadoop 2.3.0 as appendToFile with a syntax like: hdfs dfs -appendToFile localfile /user/hadoop/hadoopfile (it was first suggested in 2009 when the HDFS Append feature was being contemplated: https://issues.apache.org/jira/browse/HADOOP-6239 ) 回答2: cli doesn't support append, but httpfs and fuse both has support for appending files. w301%

How do you pipe input and output to and from an interactive shell?

拥有回忆 提交于 2021-02-08 03:33:22
问题 I am trying to build an application that enables the user to interact with a command-line interactive shell, like IRB or Python. This means that I need to pipe user input into the shell and the shell's output back to the user. I was hoping this was going to be as easy as piping STDIN, STDOUT, and STDERR, but most shells seem to respond differently to STDIN input as opposed to direct keyboard input. For example, here is what happens when I pipe STDIN into python : $ python 1> py.out 2> py.err

How do you pipe input and output to and from an interactive shell?

别说谁变了你拦得住时间么 提交于 2021-02-08 03:31:13
问题 I am trying to build an application that enables the user to interact with a command-line interactive shell, like IRB or Python. This means that I need to pipe user input into the shell and the shell's output back to the user. I was hoping this was going to be as easy as piping STDIN, STDOUT, and STDERR, but most shells seem to respond differently to STDIN input as opposed to direct keyboard input. For example, here is what happens when I pipe STDIN into python : $ python 1> py.out 2> py.err

gdb exiting instead of spawning a shell

淺唱寂寞╮ 提交于 2021-02-07 20:09:15
问题 I am trying to exploit a SUID program. The program is: #include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdio.h> #define e(); if(((unsigned int)ptr & 0xff000000)==0xca000000) { setresuid(geteuid(), geteuid(), geteuid()); execlp("/bin/sh", "sh", "-i", NULL); } void print(unsigned char *buf, int len) { int i; printf("[ "); for(i=0; i < len; i++) printf("%x ", buf[i]); printf(" ]\n"); } int main() { unsigned char buf[512]; unsigned char *ptr = buf + (sizeof(buf)/2); unsigned

Why would the PIDL for the control panel be different?

拟墨画扇 提交于 2021-02-07 14:55:28
问题 I see that one should do this to compare PIDLs: IShellFolder::CompareIDs(). In particular, I'm trying to detect if a given absolute PIDL (or relative) is that of the Control Panel. However, in practice I end up with two PIDLs which IShellFolder::CompareIDs() claims are not equal, when they should be (looking at the GetDisplayName() for each, I can see that we're indeed looking at the Control Panel). Basically, I'm obtaining the absolute PIDL for the Control panel by: PIDL iidControlPanel =

Why would the PIDL for the control panel be different?

亡梦爱人 提交于 2021-02-07 14:55:23
问题 I see that one should do this to compare PIDLs: IShellFolder::CompareIDs(). In particular, I'm trying to detect if a given absolute PIDL (or relative) is that of the Control Panel. However, in practice I end up with two PIDLs which IShellFolder::CompareIDs() claims are not equal, when they should be (looking at the GetDisplayName() for each, I can see that we're indeed looking at the Control Panel). Basically, I'm obtaining the absolute PIDL for the Control panel by: PIDL iidControlPanel =

mv a file that contains spaces from a shell script

怎甘沉沦 提交于 2021-02-07 14:49:04
问题 I am trying to mv a file (rename it to replace spaces with dashes). If I pass the source and dest arguments without quotes, the source is broken up because mv thinks it is the end of the argument. If I surround source and dest with arguments, mv reports that the source can't be found. Currently, $1 and $2 have hardcoded quotes at the beginning and end. $onam and $dnam are the equivalents without the hardcoded quotes. This command from a prompt works perfectly because source and dest are