测试脚本文件 windeal@ubuntu:~/Windeal/shell$ cat test.sh #!/bin/bash echo "hello\n" echo -e "hello\n" windeal@ubuntu:~/Windeal/shell$ 复制代码 使用./*.sh执行结果为: windeal@ubuntu:~/Windeal/shell$ ./test.sh hello\n hello windeal@ubuntu:~/Windeal/shell$ 复制代码 使用sh *.sh执行结果为 windeal@ubuntu:~/Windeal/shell$ sh test.sh hello -e hello windeal@ubuntu:~/Windeal/shell$ 复制代码 另一个错...
by Windeal - Linux新手园地 - 2014-08-21 10:49:23 阅读(2632) 回复(6)
执行sh 的时候出现下面这么两行,请问是出了什么错呢? awk: cmd. line:29: (FILENAME=cbe_subscriber_dyn.unl FNR=1) fatal: attempt to access field -2147483648 脚本如下: currdate=`date '+%Y%m%d%H%M%S'` awk -v currdate=${currdate} 'BEGIN{ OFS="|" FS="|" }{ if (FILENAME == "msisdn.list") { msisdn[$1]=sprintf("%s,%s,%s",$2,$3,$4)...
各位大虾: 我用的是redhat 3操作系统,安装了一个软件(其源文件类型 *.tar) 安装成功后 生成了一个可执行文件(比如名字叫:start) 但我运行该执行文件时 #start 报错 command not found 只有用 #sh start 才能运行 为什么会这样? 还有我想把该执行文件生成快捷方式 怎么设置 以上是我的问题希望能得到各位高手的帮助 谢谢!
各位大虾: 我用的是redhat 3操作系统,安装了一个软件(其源文件类型 *.tar) 安装成功后 生成了一个可执行文件(比如名字叫:start) 但我运行该执行文件时 #start 报错 command not found 只有用 #sh start 才能运行 为什么会这样? 还有我想把该执行文件生成快捷方式 怎么设置 以上是我的问题希望能得到各位高手的帮助 谢谢!
测试脚本文件[code]windeal@ubuntu:~/Windeal/shell$ cat test.sh #!/bin/bash echo "hello\n" echo -e "hello\n" windeal@ubuntu:~/Windeal/shell$ [/code]使用./*.sh执行结果为:[code]windeal@ubuntu:~/Windeal/shell$ ./test.sh hello\n hello windeal@ubuntu:~/Windeal/shell$ [/code]使用sh *.sh执行结果为[code]windeal@ubuntu:~/Windeal/shell$ sh test.sh hello -e hello windeal@ubuntu:~/Windeal/shell$[/code...
/sbin/sh and /usr/bin/sh shells 都是 Bourne shells. /sbin/sh is statically linked /usr/bin/sh is dynamically linked. /bin/sh /bin目录是到/usr/bin的链接 先看看属性: # ls -l /sbin/sh -r-xr-xr-x 2 bin root 251712 Jul 16 1997 /sbin/sh # ls -l /usr/bin/sh -r-xr-xr-x 3 bin root 88620 Jul 16 1997 /usr/bin/sh # file /sbin/sh /sbin/sh: ELF 32-bit MSB executable SPARC Version 1, statically linked,...
在执行xxx.sh文件时,有两种方法: sh xxx.sh和./xxx.sh 这两种方法有什么区别吗? 因为有时候会遇到这种情况: 使用命令./xxx.sh,会报错误 bash: ./RUN_setup.sh: 没有权限 但使用命令sh xxx.sh则一切正常。