我有一个方便的脚本,可以返回将在7天后过期或已过期的帐户.我想允许它在多个主机上运行,而不是将脚本放在每个单独的主机上,我添加for loop了ssh $SERVER >> EOF部件,但它只是从运行脚本的系统运行命令.
我相信错误是有的,ssh $SERVER >> EOF但我不确定语法看起来是否正确.
#!/bin/bash
for SERVER in `cat /lists/testlist`
do
echo $SERVER
ssh $SERVER >> EOF
sudo cat /etc/shadow | cut -d: -f1,8 | sed /:$/d > /tmp/expirelist.txt
totalaccounts=`sudo cat /tmp/expirelist.txt | wc -l`
for((i=1; i<=$totalaccounts; i++ ))
do
tuserval=`sudo head -n $i /tmp/expirelist.txt | tail -n 1`
username=`sudo echo $tuserval | cut -f1 -d:`
userexp=`sudo echo $tuserval | cut -f2 -d:`
userexpireinseconds=$(( $userexp * 86400 ))
todaystime=`date …Run Code Online (Sandbox Code Playgroud) type bool_exp =
TT
| FF
| Var of string
| And of bool_exp * bool_exp
| Not of bool_exp ;;
eval : bool_exp -> (string -> bool) -> bool
Run Code Online (Sandbox Code Playgroud)
我正在尝试编写一个名为的求值函数eval.我是OCaml的新手并不习惯语法.我在哪里可以写这篇文章?
我需要帮助才能在我的Debian 7.2系统上安装emacs.我查看了许多其他表单,无法安装emacs.
我已经尝试运行"sudo apt-get install emacs","sudo apt-get install emacs23",以及任何其他类型emacs的方式.
我也尝试过返回404错误.
sudo apt-get update
W: Failed to fetch http://ppa.launchpad.net/cassou/emacs/ubuntu/dists/wheezy/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
jon@debian:~$ apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://emacs.naquadah.org/ stable/ Packages
release o=jd,a=stable,n=stable,l=jd,c=
origin emacs.naquadah.org
500 http://security.ubuntu.com/ubuntu/ precise-security/main Translation-en
500 http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages
release v=12.04,o=Ubuntu,a=precise-security,n=precise,l=Ubuntu,c=main
origin security.ubuntu.com
Pinned packages:
jon@debian:~$ apt-cache policy emacs
emacs:
Installed: (none)
Candidate: 23.3+1-1ubuntu9.1
Version table: …Run Code Online (Sandbox Code Playgroud)