---
title: "在shell 中不退出控制台执行command"
author: "8366"
date: "2012-10-26T15:57:25Z"
tags: []
categories: ["编程语言"]
slug: "shell-command"
draft: false
lastmod: "2016-07-28T15:32:06Z"
id: 1706141
url: "https://8366.iteye.com/blog/1706141"
---

#!/bin/sh  
COUNTER=1  
while \[  $COUNTER -lt 101 ]; do   
        psql xcatdb xcatadm &lt;&lt; EOF  
insert into nodelist (node,groups,status,statustime,appstatustime,primarysn,hidden,updatestatus,updatestatustime,comments,disable) v  
alues ('$COUNTER','22','33','22','33','22','33','22','33','22','33');  
EOF  
        let COUNTER=COUNTER+1    
done

 

 

\-----------------

 

 

#!/bin/sh  
COUNTER=5  
egosh user logon -u Admin -x Admin  
while \[  $COUNTER -lt 101 ]; do  
        egosh &lt;&lt; EOF  
        client reg  -c dd -MDS  
        alloc new -P rp1 -p /A -M 1 -d ncpus=0.1,maxmem=1-P rp1 -p /A -M 1 -d ncpus=0.1,maxmem=1  
EOF  
        let COUNTER=COUNTER+1  
done