2023-05-02 23:48来源:m.sf1369.com作者:宇宇
1、Shell$ExitCodeException
现象:运行hadoop job时出现如下异常:
14/07/09 14:42:50 INFO mapreduce.Job: Task Id : attempt__0007_m_000000_1, Status : FAILED
Exception from container-launch: org.apache.hadoop.util.Shell$ExitCodeException:
org.apache.hadoop.util.Shell$ExitCodeException:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:505)
at org.apache.hadoop.util.Shell.run(Shell.java:418)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:650)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)
root@localhost:~# cat 1
2222|ABC:1|aaaaa:2
333|gadm:1|aaaa:12
root@localhost:~# cat 1|awk -F[| :] '{print $1|$2|$5}'
2222|ABC|2
333|gadm|12
处理Shell 函数传人参数中包含的特殊字符,要根据shell函数内部实现来具体问题具体分析。
一般来说,将入参作为参数再传入其他函数时,不需 ,直接传入。
如果要查找入参中的特殊字符,需要用\转义