troyski.co.uk Unix tips, food reviews and astronomy.
  • Home
  • About
  • FAQs
    • AIX Tips
    • General Tips
    • HP-UX Tips
    • KSH Tips
    • Linux Tips
    • Mac OS X Tips
    • SCO Tips
    • Software Tips
    • VxVM
    • Windows Tips
    • Solaris
    • zLinux Tips
    • zVM Tips
  • Photography
    • Instagram Gallery
  • Restaurant Map
  • Food
    • Chinese
    • Greek
    • Indian
    • Italian
    • Others
    • Pub Grub
    • Thai
  • Admin

Daily Archives: January 19, 2005

You are browsing the site archives by date.
19Jan 2005

Finding the contents of a variable within a string

by troyski ⋅ Leave a Comment

 

Sounds hard, but quite easy…

var=”pattern to find”

string=”Full string where the pattern to find is.”

echo “$string” | grep “$var”

rc=$?

if [[ $rc = 0 ]];then

echo “I found $var in $string”

fi

Search

Pages

  • About
  • AIX Tips
  • Cookies
  • General Tips
  • HP-UX Tips
  • Instagram Gallery
  • KSH Tips
  • Linux Tips
  • Mac OS X Tips
  • Restaurant Map
  • SCO Tips
  • Software Tips
  • Statistics
  • Windows Tips
  • zLinux Tips
  • zVM Tips

Links

  • AIX SystemScan software
  • Muller Afloat. My brother's musings living on a narrow boat with his family.
  • Pete Sweets' Band
  • Subnet mask cheat sheet
  • TechieTubbies AIX Hints and Tips
  • Troyski Limited
January 2005
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Nov   Feb »

Recent Comments

  • .screenrc example « troyski.org.uk on tmux command
  • Chutney, St. Helens « troyski.org.uk on Arena
  • Troyski on How do I sniff a port using tcpdump?
  • troyski on Creating dummy disks on AIX.
  • GaryC on Creating dummy disks on AIX.

Recent Posts

  • Family Ages
  • The First
  • Banana pancakes
  • X-Spicy Chipotle Southwest Sauce
  • Festive Cinnamon Rolls

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

AIX aix disk AIX path fscsi AIX tar copy aix ulimit aix wtmp bash cluster monitor Curry indian curry review iso mount solaris IT comment prediction security authentication landscape sunset photo linux moon iphone celestron order password portugese restaurant powerpath random rhel6 script solaris sunos duplex nic interface sort tmux screen terminal vcs veritas volume manager verities VxVM
© Copyright 2025 - troyski.co.uk
Contango Theme ⋅ Powered by WordPress
Unix tips, food reviews and astronomy.
  • Home
  • About
  • FAQs
  • Photography
  • Restaurant Map
  • Food
  • Admin