- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Another Newbie Question 'For Syntax'
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
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
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
09-07-2004 07:43 AM
09-07-2004 07:43 AM
For($i=0; $i<$total; $i+9) {
whatever I want to do
}
Does Posix have a similar syntax to do this? I've looked in the sh-posix man pages and haven't come up with this type of loop. Can anyone help me again?
Thanks
Scott
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2004 07:46 AM
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2004 01:39 AM
09-08-2004 01:39 AM
Re: Another Newbie Question 'For Syntax'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2004 05:05 AM
09-08-2004 05:05 AM
Re: Another Newbie Question 'For Syntax'
i=0
total=10
until [[ $i -gt $total ]]
do
echo $i
# loop increment
let i=i+1
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2004 05:21 AM
09-08-2004 05:21 AM
Re: Another Newbie Question 'For Syntax'
This may not be what you are looking for. But as far as I know, there is no loop construct like that in Posix.
FOR loop in posix will only accept list of values, not the range of values.
You can try something like this
for I in 0 1 2 3 4 5 6 7 8 9
But clearly, it is not an elegant or effective way of scripting.
-- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2004 04:57 PM
09-08-2004 04:57 PM
Re: Another Newbie Question 'For Syntax'
i=0
total=10
echo "$i $total" | awk '{ for ( i=$1; i<=$2; i++)
- Muthu
- Tags:
- awk