|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Can't work out a pattern that will match a certain string!
I'm trying to do a case statement, where one of the patterns must identify any parameters which don't have a '.' (dot in them),
i.e., if my list of variable were red.txt blue.txt yellow.txt green I would need the pattern to identify the 'green' one, as this doesn't have a . in it. I've been trying patterns along the line of this: *'.'*) but this identifies every variable name, with or without a dot in it. Been trying to do this for days now!! Thanks very much for any help. Jess |
|
#2
|
|||
|
|||
|
Quote:
Hello, perhaps I do not understand properly what you mean. On HP-UX under Bourne shell the simple pattern *.* does the yob: : while read P ; do case $P in *.*) echo "here is a dot:" $P;; *) echo "without a dot:" $P;; esac done <<! red.txt blue.txt yellow.txt green ! Try it ![]() |
|
#3
|
|||
|
|||
|
[QUOTE=zlutovsky]
case $P in *.*) echo "here is a dot:" $P;; *) echo "without a dot:" $P;; esac QUOTE] That was what I needed! I needed put this in a case statement of its own so I could use the 'anything else' option! Thanks v much! Your help is much appreciated! ![]() |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Can't work out a pattern that will match a certain string! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|