<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alias question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645443#M676705</link>
    <description>&lt;!--!*#--&gt;&amp;gt;how can I put alias for 'vgdisplay -v vg01' for 'vgdisplay -v vg02'&lt;BR /&gt;&lt;BR /&gt;You can not.  You should give up on aliases and use functions or scripts:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;# vgdisplay -v vg01 # We get the result for 'vgdisplay -v vg02'&lt;BR /&gt;&lt;BR /&gt;vgdisplay:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;if [ X"$1" = "X-v" -a X"$2" = Xvg01 ]; then&lt;BR /&gt;   /usr/sbin/vgdisplay -v vg02&lt;BR /&gt;else&lt;BR /&gt;   /usr/sbin/vgdisplay "$@"&lt;BR /&gt;fi</description>
    <pubDate>Thu, 10 Jun 2010 07:23:04 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-06-10T07:23:04Z</dc:date>
    <item>
      <title>Alias question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645440#M676702</link>
      <description>&lt;!--!*#--&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;We can set alias by:&lt;BR /&gt;# alias ls='ls -al'&lt;BR /&gt;&lt;BR /&gt;But, what if I want to set an alias for:&lt;BR /&gt;"vgdisplay -v" to "abc"&lt;BR /&gt;&lt;BR /&gt;So, I can run:&lt;BR /&gt;# abc vg01 &lt;BR /&gt;and get results for "vgdisplay -v vg01".&lt;BR /&gt;&lt;BR /&gt;Is that possible?&lt;BR /&gt;Thanks..</description>
      <pubDate>Thu, 10 Jun 2010 03:19:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645440#M676702</guid>
      <dc:creator>UniRock</dc:creator>
      <dc:date>2010-06-10T03:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alias question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645441#M676703</link>
      <description>y not ???&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# alias abc='vgdisplay -v'&lt;BR /&gt;[rx260-13]/&lt;BR /&gt;# abc vg00&lt;BR /&gt;--- Volume groups ---&lt;BR /&gt;VG Name                     /dev/vg00&lt;BR /&gt;VG Write Access             read/write&lt;BR /&gt;VG Status                   available&lt;BR /&gt;Max LV                      255&lt;BR /&gt;Cur LV                      8&lt;BR /&gt;Open LV                     8&lt;BR /&gt;Max PV                      16&lt;BR /&gt;Cur PV                      1&lt;BR /&gt;Act PV                      1&lt;BR /&gt;Max PE per PV               4356&lt;BR /&gt;VGDA                        2&lt;BR /&gt;PE Size (Mbytes)            32&lt;BR /&gt;Total PE                    4346&lt;BR /&gt;Alloc PE    &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sooraj</description>
      <pubDate>Thu, 10 Jun 2010 04:04:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645441#M676703</guid>
      <dc:creator>SoorajCleris</dc:creator>
      <dc:date>2010-06-10T04:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Alias question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645442#M676704</link>
      <description>&lt;!--!*#--&gt;Thanks Sooraj,&lt;BR /&gt;&lt;BR /&gt;I guess I have put the question in a wrong way. Let me give an example, how can I put alias for 'vgdisplay -v vg01' for 'vgdisplay -v vg02', so that when I execute the command:&lt;BR /&gt;# vgdisplay -v vg01&lt;BR /&gt;We get the result for 'vgdisplay -v vg02'....something like:&lt;BR /&gt;&lt;BR /&gt;# alias 'vgdisplay -v vg01'='vgdisplay -v vg02'   &amp;lt;&amp;lt;&amp;lt;&amp;lt; well this do not work :-(&lt;BR /&gt;&lt;BR /&gt;So, I am looking on how to use multiple words on both sides of '=' while using alias.&lt;BR /&gt;&lt;BR /&gt;May be it is more clear this time :-)</description>
      <pubDate>Thu, 10 Jun 2010 05:30:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645442#M676704</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2010-06-10T05:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Alias question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645443#M676705</link>
      <description>&lt;!--!*#--&gt;&amp;gt;how can I put alias for 'vgdisplay -v vg01' for 'vgdisplay -v vg02'&lt;BR /&gt;&lt;BR /&gt;You can not.  You should give up on aliases and use functions or scripts:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;# vgdisplay -v vg01 # We get the result for 'vgdisplay -v vg02'&lt;BR /&gt;&lt;BR /&gt;vgdisplay:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;if [ X"$1" = "X-v" -a X"$2" = Xvg01 ]; then&lt;BR /&gt;   /usr/sbin/vgdisplay -v vg02&lt;BR /&gt;else&lt;BR /&gt;   /usr/sbin/vgdisplay "$@"&lt;BR /&gt;fi</description>
      <pubDate>Thu, 10 Jun 2010 07:23:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645443#M676705</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-06-10T07:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alias question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645444#M676706</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;in fact you need to use a function and not an alias&lt;BR /&gt;function vgdisplay {&lt;BR /&gt;if [ $# = 0 ]&lt;BR /&gt;then&lt;BR /&gt;/usr/sbin/vgdisplay&lt;BR /&gt;return $?&lt;BR /&gt;fi&lt;BR /&gt;set -A x -- "$@"&lt;BR /&gt;typeset -i xs=${#x[*]}-1&lt;BR /&gt;target="${x[xs]}"&lt;BR /&gt;if [ "${x[xs]}" = vg01 ]&lt;BR /&gt;then&lt;BR /&gt;  x[xs]=vg00&lt;BR /&gt;fi&lt;BR /&gt;/usr/sbin/vgdisplay "${x[@]}"&lt;BR /&gt;return $?&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2010 07:49:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alias-question/m-p/4645444#M676706</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2010-06-10T07:49:56Z</dc:date>
    </item>
  </channel>
</rss>

