- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- conditional grep thru ftp
Operating System - HP-UX
1753805
Members
7636
Online
108805
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО10-22-2008 04:36 AM
тАО10-22-2008 04:36 AM
conditional grep thru ftp
Hi,
I'm trying to grep for a process & if it exists, tail a file. This needs to be done thru a ftp script
Checks for the process
sndline "ps -eaf | grep process | grep -v grep"
receive ">"
I know if I was in a script, I could
ps -eaf | grep process | grep -v grep
if [ $? -eq 0 ]
then
tail afiles
fi
How do I put the 2 together?
thanks
I'm trying to grep for a process & if it exists, tail a file. This needs to be done thru a ftp script
Checks for the process
sndline "ps -eaf | grep process | grep -v grep"
receive ">"
I know if I was in a script, I could
ps -eaf | grep process | grep -v grep
if [ $? -eq 0 ]
then
tail afiles
fi
How do I put the 2 together?
thanks
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 04:49 AM
тАО10-22-2008 04:49 AM
Re: conditional grep thru ftp
Shalom,
grep command is not available in an ftp session.
You must use grep to create a file and then a second process to ftp it where you want it to go.
You can in your second loop integrate an ftp scrip loop.
SEP
grep command is not available in an ftp session.
You must use grep to create a file and then a second process to ftp it where you want it to go.
You can in your second loop integrate an ftp scrip loop.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 05:03 AM
тАО10-22-2008 05:03 AM
Re: conditional grep thru ftp
ftp is the wrong term :(
I'm actually using a tcp connection to various addresses and check for a hung process
sndline "ps -eaf | grep process| grep -v grep"
receive ">"
works and displays to my screen. If the process exists, I'd like to tail a file
thanks
I'm actually using a tcp connection to various addresses and check for a hung process
sndline "ps -eaf | grep process| grep -v grep"
receive ">"
works and displays to my screen. If the process exists, I'd like to tail a file
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 05:10 AM
тАО10-22-2008 05:10 AM
Re: conditional grep thru ftp
Hi :
I suppose you could get there from here in a round-about fashion.
You could execute an FTP script and within the FTP session do:
!ps -ef ...
You would want to collect the FTP session in a file that you can parse. Use the '-v' option to FTP and redirect like:
ftp -in -v >> /var/tmp/ftp.$$ 2>&1
Once you have run the *first* ftp, examine the log you created and based on its contents execute a second FTP to do whatever you want.
Regards!
...JRF...
I suppose you could get there from here in a round-about fashion.
You could execute an FTP script and within the FTP session do:
!ps -ef ...
You would want to collect the FTP session in a file that you can parse. Use the '-v' option to FTP and redirect like:
ftp -in -v >> /var/tmp/ftp.$$ 2>&1
Once you have run the *first* ftp, examine the log you created and based on its contents execute a second FTP to do whatever you want.
Regards!
...JRF...
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP