HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Replying to prompts within a script
Operating System - HP-UX
        1839873
        Members
    
    
        3792
        Online
    
    
        110156
        Solutions
    
Forums
        Categories
Company
Local Language
                
                  
                  back
                
        
                
        
                
        
                
        
        
        
                
        
                
        
        
        
                
        
              
              Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
                
                  
                  back
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
            
                
            
                
            
                
            
                
            
            
                
            
                
            
            
                
            
                
              
            Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
        Information
        Community
Resources
Community Language
        Language
        Forums
Blogs
	
		
			
            
                
            Go to solution
        
            
		
		
			
            	
	
		
        
		
	
	
		Topic Options
			
				
					
	
			
		
	- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2010 06:20 AM
12-09-2010 06:20 AM
			
				
					
					
						I want to run a command within a script, but the command requires a reply:
# gfs_tool reclaim /gfs/saweb
Don't do this if this file system is being exported by NFS (on any machine).
Are you sure you want to proceed? [y/n] n
gfs_tool: aborted
#
Is there a way to code this command in a script to supply it with a "y" to continue on ???
	
			
				
		
			
			
			
			
			
			
		
		
		
	
	
	
# gfs_tool reclaim /gfs/saweb
Don't do this if this file system is being exported by NFS (on any machine).
Are you sure you want to proceed? [y/n] n
gfs_tool: aborted
#
Is there a way to code this command in a script to supply it with a "y" to continue on ???
Solved! Go to Solution.
		3 REPLIES 3
	
	            
            
		
		
			
            
                - Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2010 07:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2010 07:11 AM
12-09-2010 07:11 AM
			
				
					
						
							Re: Replying to prompts within a script
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Matti
Thanks, I wasn't even thinking of something so simple would work...
		
		
	
	
	
Thanks, I wasn't even thinking of something so simple would work...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2010 06:00 AM
12-10-2010 06:00 AM
			
				
					
						
							Re: Replying to prompts within a script
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Sometimes that won't work.
If you have a lot of yeses, you could use "yes"...
yes | gfs_tool reclaim /gfs/saweb
Or, you can also do something like this:
gfs_tool reclaim /gfs/saweb << EOL
y
EOL
This will enter all of the replies in order. Works really well for configuring something larger too, like EMS. The example below would get you monitors for snmp, email and log outputs:
/etc/opt/resmon/lbin/monconfig << EOL
a
a
1
4
4
/var/opt/resmon/log/event.log
c
c
y
a
a
3
4
5
c
c
y
a
a
2
4
6
admins@mydomain.ca
c
c
y
a
a
3
5
3
c
c
y
a
a
4
5
3
c
c
y
a
a
5
5
3
c
c
y
e
q
EOL
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
		
	
	
	
If you have a lot of yeses, you could use "yes"...
yes | gfs_tool reclaim /gfs/saweb
Or, you can also do something like this:
gfs_tool reclaim /gfs/saweb << EOL
y
EOL
This will enter all of the replies in order. Works really well for configuring something larger too, like EMS. The example below would get you monitors for snmp, email and log outputs:
/etc/opt/resmon/lbin/monconfig << EOL
a
a
1
4
4
/var/opt/resmon/log/event.log
c
c
y
a
a
3
4
5
c
c
y
a
a
2
4
6
admins@mydomain.ca
c
c
y
a
a
3
5
3
c
c
y
a
a
4
5
3
c
c
y
a
a
5
5
3
c
c
y
e
q
EOL
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
		
	
	
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP