# i want to know entered string ends with .jar

**URL:** <https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295>\
**Category:** Shell Programming and Scripting\
**Created:** [March 8, 2008, 5:08am UTC](https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295 "2008-03-08T05:08:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![naree](https://community.unix.com/letter_avatar/naree/32/5_5575768a8748004e209b776fc1b2916d.png) [@naree](https://community.unix.com/u/naree)\
**Post date:** [March 8, 2008, 5:08am UTC](https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295/1 "2008-03-08T05:08:02Z")

</div>

Hi all,

```
     I want to know whelther string entered ends with .jar. Can any one help please..

```

Thank U  
Naree

---

<div class="post-metadata">

**Author:** ![ghostdog74](https://community.unix.com/letter_avatar/ghostdog74/32/5_5575768a8748004e209b776fc1b2916d.png) [@ghostdog74](https://community.unix.com/u/ghostdog74)\
**Post date:** [March 8, 2008, 5:22am UTC](https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295/2 "2008-03-08T05:22:29Z")

</div>

```nohighlight
case $input in 
  *jar ) 
     echo "end in jar" ;;
esac

```

---

<div class="post-metadata">

**Author:** ![naree](https://community.unix.com/letter_avatar/naree/32/5_5575768a8748004e209b776fc1b2916d.png) [@naree](https://community.unix.com/u/naree)\
**Post date:** [March 8, 2008, 5:48am UTC](https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295/3 "2008-03-08T05:48:15Z")

</div>

Thanks a Lot !!! It really works.

Don't Mind can u tell me with awk command and print "jar" file extensions

---

<div class="post-metadata">

**Author:** ![ghostdog74](https://community.unix.com/letter_avatar/ghostdog74/32/5_5575768a8748004e209b776fc1b2916d.png) [@ghostdog74](https://community.unix.com/u/ghostdog74)\
**Post date:** [March 8, 2008, 6:24am UTC](https://community.unix.com/t/i-want-to-know-entered-string-ends-with-jar/188295/4 "2008-03-08T06:24:41Z")

</div>

```nohighlight
 # echo "sdf.jar" |awk '/jar$/{print "end in jar"}'
end in jar

```
