- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script...
Categories
Company
Local Language
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
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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-02-2001 02:50 AM
тАО10-02-2001 02:50 AM
I want write script for command:
#dcNLS *.err,
where *.err - 16 files.
How can write it for processing this files? What syntax for processing of group files?
Thanx in advance. Oleg
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2001 03:02 AM
тАО10-02-2001 03:02 AM
Re: Script...
Lots of ways, in a ksh, try this:
for file in *.err ; do
dcNLS $file
done
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2001 05:29 AM
тАО10-02-2001 05:29 AM
Re: Script...
#!/bin/sh
cd /destination directory
for FILE in *.err; do
command $FILE
done
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2001 07:20 PM
тАО10-02-2001 07:20 PM
Re: Script...
In case $file will be processing all files in directory ?
But I need processing only group of files. How I can to specify in script which files need process?
Oleg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2001 11:09 PM
тАО10-02-2001 11:09 PM
Re: Script...
The syntax:
for file in *.err ; do
...
done
will loop round all the files ending in .err, processing them **one at a time**. If you wish to specify a different group of files, you will need to work out how these are identified.
You can put in a multiple list, or have them listed in a file, i.e..
for file in *.err *.log *.txt ; do
command $file
done
cat filename | while read file ; do
command file
done
Please provide more information if this is not what you mean.
Thanks and regards, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2001 12:19 AM
тАО10-04-2001 12:19 AM
Re: Script...
Thanx for answer a excuse me for late reaction.
I did script:
cat list | while read list; do
dcNLS *.err > kkk
done
where list - file with list of files that need to process.
But script process all *err.files. :(
Where My mistake?
Excuse me Robin? but can "present" link at description for command that use in scripts. At russian I didnt saw, at english I didnt know where..
Oleg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2001 12:32 AM
тАО10-04-2001 12:32 AM
SolutionYour script should read:
cat list | while read file; do
echo Processing $file ...
dcNLS $file >> kkk # NOT -> dcNLS *err <-
done
I left off the "$" in my previous answer - sorry. The echo statement will let you know which file it is processing. Use a double ">" for redirection otherwise it will get overwritten each time.
Hope this helps, Robin.