- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Directory specs
Operating System - HP-UX
1753971
Members
8403
Online
108811
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
тАО12-13-2002 07:30 PM
тАО12-13-2002 07:30 PM
Directory specs
I'm writing an automated online backup script for an Oracle database. I have a script that dynamically builds the directory lookups for things such as archive logs. In short my archive log directory is set to something like /exports/archive_logs/
Later in the script I want to do a test like
if [ -f $ARC*]; then blah blah blah.
I need a way to concatenate an asterisk to the end of the directory above to perform the test. Performing it as written above tests for files in the current directory and not in /exports/archive_logs/. Conversely, can you tell me how to remove the asterisk from the end of a string as well. Can this be done with SED?
Thanks!!!
Later in the script I want to do a test like
if [ -f $ARC*]; then blah blah blah.
I need a way to concatenate an asterisk to the end of the directory above to perform the test. Performing it as written above tests for files in the current directory and not in /exports/archive_logs/. Conversely, can you tell me how to remove the asterisk from the end of a string as well. Can this be done with SED?
Thanks!!!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2002 07:55 PM
тАО12-13-2002 07:55 PM
Re: Directory specs
Allen,
how about testing/doing something like this:
for i in `find /exports/archive_logs -type f`
do
echo do something with this file $i
done
live free or die
harry
how about testing/doing something like this:
for i in `find /exports/archive_logs -type f`
do
echo do something with this file $i
done
live free or die
harry
Live Free or Die
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2002 07:59 PM
тАО12-13-2002 07:59 PM
Re: Directory specs
harry,
The problem is that I'm stuck with the / at the end of /exports/archive_logs/.
The problem is that I'm stuck with the / at the end of /exports/archive_logs/.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2002 09:20 PM
тАО12-13-2002 09:20 PM
Re: Directory specs
hi allen,
why can't you just
1. "cd" to the desired directory
2. ls -rt1 ./*.log > backup.list
3. then do any desired operations:
E.g.1:
--------------------------------
tar uvf $DAT `cat backup.list`
--------------------------------
E.g. 2:
----------------------------
for i in `cat backup.list`
do
echo
echo "Renaming $i to:\c "
file=`basename $i .log`
echo "$file.bak"
mv $i $file.bak
done
----------------------------
Hope this helps!
Best Regards
Yogeeraj
why can't you just
1. "cd" to the desired directory
2. ls -rt1 ./*.log > backup.list
3. then do any desired operations:
E.g.1:
--------------------------------
tar uvf $DAT `cat backup.list`
--------------------------------
E.g. 2:
----------------------------
for i in `cat backup.list`
do
echo
echo "Renaming $i to:\c "
file=`basename $i .log`
echo "$file.bak"
mv $i $file.bak
done
----------------------------
Hope this helps!
Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
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