ChinaUnix.net
相关文章推荐:

bash shell 执行python脚本

shell脚本mytest.sh很简单就是 date 但是执行的时候就报,-bash: .mytest.sh: command not found 我的$PATH环境变量也有啊,而且.mytest.sh我是chmod 777 mytest.sh的权限也够啊,那位朋友有碰到这种情况给我解答下

by renwox88 - Shell - 2008-06-27 15:52:04 阅读(12431) 回复(13)

相关讨论

有一个脚本是用c shell写的,可是我用的是bash,source不了,将脚本第一行改为#!/bin/csh后还是不行,请问,如果在bash中,执行c shell脚本??

by 3x3eyes - Solaris - 2004-12-03 18:39:47 阅读(1599) 回复(4)

b.sh: line 17: [: -lt: unary operator expected

by kaka_sun - Shell - 2006-10-08 14:36:44 阅读(1096) 回复(2)

各位大侠: 比如我现在想执行一个简单的shell命令date,据我所知,在python里用os.system("date")。 但它的返回值是0或者1,我想要在python中保存date命令的执行结果,也就是当前的时间日期信息。 请问怎么弄啊? 谢谢~

by godmatrix - Python - 2009-07-08 17:18:17 阅读(8252) 回复(5)

RT 例如在shell脚本中直接写入 code: expect{ "*(yes/no)? " {send "yes\r"} "*password:" {send "$passwd\r"} "*Permission denied*" {send_user "Permission denied\n" close set done 0 break } "*Connection refused*" {send_user "Connection refused\n" close set done 0 ...

by kidd05 - Shell - 2008-09-10 10:54:50 阅读(5864) 回复(5)

declare -i total find /ar/local/nectar/log/ -name "userfile1.log " -print |xargs awk '$16~/ dropped/ {print $1,$2,$3;total++}'> sctpMessageDropReport.log find /ar/local/nectar/log/ -name "userfile2.log " -print |xargs awk '$16~/ dropped/ {print $1,$2,$3;total++}' >sctpMessageDropReport.log ......................... 复制以上俩个语句 修改find命令搜索的目录 注意 这里的total 是相同的 下面这句话...

by jyz1117 - Shell - 2008-02-21 12:42:44 阅读(1247) 回复(4)

可以吗? 使用bash脚本令当前用户从一个已login的bash shell中退出(完全退出, 即相当于普通情况下使用exit命令的效果.). 怎么写? 谢谢大侠们指点!

by akara - Linux论坛 - 2003-07-20 18:13:00 阅读(789) 回复(4)

第一个 #! /bin/bash clear echo '你想知道......[y/n]' read choice if [ $choice=y ] then echo -n '当前用户:' whoami echo -n '现在的时间是:' date echo -n '你的工作目录是:' pwd fi if [ $choice=n ] then echo '谢谢使用!!!' fi这个出毛病了,y和n的结果是一样的!!! ============================================== 第二个 #! /bin/bash clear echo -n '你想知道......[y/n]' ...

by 衍水狂客 - Shell - 2008-11-22 09:32:15 阅读(3166) 回复(19)

BSD系统中,python脚本可以像shell脚本那样直接执行,只要在脚本文件开头写一行命令,指定文件和模式: #! /usr/bin/env python (将用户路径通知解释器) “#!”必须是文件的前两个字符,在某些平台上,第一行必须以Unix风格的行结束符(“\n”)结束,不能用Mac(“\r”)或Windows(“\r\n”)的结束符。注意,“#”是python中是行注释的起始符。 脚本可以通过 chmod 命令指定执行模式和许可权。 $ chmod +x myscript.py ...

by atyu30 - BSD文档中心 - 2007-10-21 23:46:49 阅读(1046) 回复(0)

.知识 objFile=open("filename", 'rw') line=objFile. readline() objFile.close() urllib.urlencode({'a':1, 'b':2,'c':3}) os.system("cmd") str.split(separator_char) len(line) str.strip(char) .mail_list.txt "11" "123456" "tom" "abc@xx.com" "19" "123456" "tom1" "abcd@xx.com" "20" "123456789" "tom2" "abcde@xx.com" "18" "123410" "tom3" "abcdef@xx.com" "13" "123456" "tom4" "abcdefg@xx.com" "11" "...

by cnscn2008 - Python文档中心 - 2007-05-11 16:26:41 阅读(1346) 回复(0)

shell输出一些值或变量。 A=aaaaaaaaa B=bbbbbbbbb C=ccccccccc 如何把这些值传到python脚本里去?

by 枫影谁用了 - Shell - 2008-11-07 11:32:18 阅读(6153) 回复(2)