shell脚本 ls *出来的结果 赋值成一个变量运用到isql 中,请教unix高手帮忙解答一下
脚本如下:wkdb=/home/backup/today/*su-sybase-c"isql-Usa-P<<EOFloaddatabaseMBFEWKDBfrom'$wk...
脚本如下:
wkdb=/home/backup/today/*
su - sybase -c " isql -Usa -P <<EOF
load database MBFEWKDB from '$wkdb'
go
online database MBFEWKDB
go
dump tran MBFEWKDB with truncate_only
go
EOF"
~
脚本运行结果如下:
Backup Server: 4.26.2.1: Volume validation error: failed to obtain device
information, device: /home/backup/today/* error: No such file or directory.
正确的目录文件是/home/backup/today/20101223151331.wkdb
在/home/backup/today/这个目录下有一个文件名字随机。
# wkdb=/home/backup/today/*
# echo $wkdb
/home/backup/today/20101223151331.wkdb 我就想把这一行赋值成一个变量 展开
wkdb=/home/backup/today/*
su - sybase -c " isql -Usa -P <<EOF
load database MBFEWKDB from '$wkdb'
go
online database MBFEWKDB
go
dump tran MBFEWKDB with truncate_only
go
EOF"
~
脚本运行结果如下:
Backup Server: 4.26.2.1: Volume validation error: failed to obtain device
information, device: /home/backup/today/* error: No such file or directory.
正确的目录文件是/home/backup/today/20101223151331.wkdb
在/home/backup/today/这个目录下有一个文件名字随机。
# wkdb=/home/backup/today/*
# echo $wkdb
/home/backup/today/20101223151331.wkdb 我就想把这一行赋值成一个变量 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询