- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Tru64 shell script
Operating System - Tru64 Unix
1752815
Members
4658
Online
108789
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
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
тАО01-16-2006 08:24 AM
тАО01-16-2006 08:24 AM
Hello to everybody !!!
I'm making a shell script and I have de difficult.
In a case statement I used:
case $REPLY in
[1-$var] ) list ;;
so, when $var is greater than 9 then patter [1-$var] ) is not replace how I like.
for example when $var=12
[1-12] ) patter is how [1-1] )
helme please
I'm making a shell script and I have de difficult.
In a case statement I used:
case $REPLY in
[1-$var] ) list ;;
so, when $var is greater than 9 then patter [1-$var] ) is not replace how I like.
for example when $var=12
[1-12] ) patter is how [1-1] )
helme please
Solved! Go to Solution.
- Tags:
- case
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 08:52 AM
тАО01-16-2006 08:52 AM
Re: Tru64 shell script
The range goes between 0 and 9, so, if you want to test a two digit number, you need something like:
[0-$var] ) list ;;
[0-9][0-$var] ) list ;;
[0-$var] ) list ;;
[0-9][0-$var] ) list ;;
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 10:18 PM
тАО01-16-2006 10:18 PM
Solution
In fact, the above is wrong, it should be:
[0-$var] ) list ;;
[0-9][0-9] ) list ;;
Anyway, you can use:
if [ $REPLY -ge 1 ] && [ $REPLY -le $var ]; then
echo "The value is in the range 1-12"
list
fi
[0-$var] ) list ;;
[0-9][0-9] ) list ;;
Anyway, you can use:
if [ $REPLY -ge 1 ] && [ $REPLY -le $var ]; then
echo "The value is in the range 1-12"
list
fi
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
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