在不同的控制台 (CYRADM) 中执行脚本或命令



感谢:

你好 IM 尝试执行从其他稳定脚本中提取的不同命令,这些脚本用于提取我们必须在 cyradm 控制台中执行的命令 我愿意

[root@srvmtrx9870]# sh addFolder2Mailbox.sh > commands.sh

这会生成一个脚本.sh我永远无法在 cyradm 控制台中执行(永远失败(找不到命令 我尝试了很多事情,但我开始认为使用简单的 shell 或 bash 脚本是不可能的

例:

localhost>  ./commands.sh
./commands.sh: línea 1: cm: no se encontró la orden
./commands.sh: línea 2: sam: no se encontró la orden
./commands.sh: línea 3: cm: no se encontró la orden
./commands.sh: línea 4: sam: no se encontró la orden
./commands.sh: línea 5: cm: no se encontró la orden
./commands.sh: línea 6: sam: no se encontró la orden
./commands.sh: línea 7: quit: no se encontró la orden

当我只放命令工作时

localhost> cm
usage: createmailbox [--partition partition] mailbox [partition]
cat commands.sh
cm 'user/'
sam 'user/'  lrswipcda
cm 'user/xxxxxxxxxxxxxxxxxxxxxxx'
sam 'user/xxxxxxxxxxxxxxxxxxxxxxx'  lrswipcda
cm 'user/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxx'
sam 'user/xxxxxxxx/xxxxxxxxxxxxxxxxxxxx'  lrswipcda
quit

BASH 是外壳(或看起来(

localhost> echo $BASH
/bin/sh

和 IM 根

localhost> whoami
root

脚本具有适当的权限 (我编辑了一些文字更改个人信息由xxxxxx( 有人知道如何在 cyradm 控制台中执行外部脚本吗?,我尝试了很多东西,但对我没有任何用处..

#!/bin/bash
echo "Need IMAP password , please input password"
{
cyradm --user mailadmin localhost << EOT
cm
sam
EOT
} >> error.out

最新更新