<?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 Script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847840#M92646</link>
    <description>HI,&lt;BR /&gt;I have a script written below which loops through a list of machines and creates a symbolic pointing to a filesystem:&lt;BR /&gt;&lt;BR /&gt;I'd like to have the link as:&lt;BR /&gt;#ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disks88&lt;BR /&gt;&lt;BR /&gt;Note that psc in /prj/pscx/psc/disks/disks88 is also a symbolic link pointing to /prj/pscx,&lt;BR /&gt;hence a pointer to itself i.e /prj/pscx&lt;BR /&gt;i.e:&lt;BR /&gt;cd /prj/pscx&lt;BR /&gt;ln -s . psc  &lt;BR /&gt;&lt;BR /&gt;On some machines, /prj/pscx or /prj does not exist.&lt;BR /&gt;&lt;BR /&gt;!#/bin/sh&lt;BR /&gt;for i in 'cat machine_list' &lt;BR /&gt;do&lt;BR /&gt;   if [ ! -d /prj ];then&lt;BR /&gt;      mkdir /prj&lt;BR /&gt;      cd prj&lt;BR /&gt;      mkdir /prj/pscx&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj&lt;BR /&gt;   if [ ! -d /prj/pscx ];then&lt;BR /&gt;      mkdir /prj/pscx/&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj/pscx&lt;BR /&gt;   if [ ! -L /prj/pscx/psc];then&lt;BR /&gt;      ln -s /prj/pscx/ /prj/pscx/psc&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj/pscx/psc&lt;BR /&gt;   if [ ! -d /prj/pscx/psc/disks ];then&lt;BR /&gt;      mkdir /prj/pscx/psc/disks &lt;BR /&gt;      cd disks&lt;BR /&gt;      if [ ! - L /prj/pscx/psc/disks/disk88 ];then&lt;BR /&gt;         ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disk88&lt;BR /&gt;      fi&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;However, it does not create the symbolic link /prj/pscx/psc/disks/disk88. It only creates until /prj/pscx/psc/disks. &lt;BR /&gt;&lt;BR /&gt;Moreover, how do I get the directory /prj/pscx/psc/disks to be created under /prj/pscx/psc, which is only a link? (Don't ask what this link is for - user's request which cannot be refused)&lt;BR /&gt;&lt;BR /&gt;Currently, it only creates /prj/pscx/psc/disks under /prj/pscx as /prj/pscx/psc points to itself i.e /prj/pscx/psc.&lt;BR /&gt;&lt;BR /&gt;Could someone kindly help me out? Or show me how the script should have been done properly?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Nov 2002 14:21:18 GMT</pubDate>
    <dc:creator>Chern Jian Leaw</dc:creator>
    <dc:date>2002-11-19T14:21:18Z</dc:date>
    <item>
      <title>Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847840#M92646</link>
      <description>HI,&lt;BR /&gt;I have a script written below which loops through a list of machines and creates a symbolic pointing to a filesystem:&lt;BR /&gt;&lt;BR /&gt;I'd like to have the link as:&lt;BR /&gt;#ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disks88&lt;BR /&gt;&lt;BR /&gt;Note that psc in /prj/pscx/psc/disks/disks88 is also a symbolic link pointing to /prj/pscx,&lt;BR /&gt;hence a pointer to itself i.e /prj/pscx&lt;BR /&gt;i.e:&lt;BR /&gt;cd /prj/pscx&lt;BR /&gt;ln -s . psc  &lt;BR /&gt;&lt;BR /&gt;On some machines, /prj/pscx or /prj does not exist.&lt;BR /&gt;&lt;BR /&gt;!#/bin/sh&lt;BR /&gt;for i in 'cat machine_list' &lt;BR /&gt;do&lt;BR /&gt;   if [ ! -d /prj ];then&lt;BR /&gt;      mkdir /prj&lt;BR /&gt;      cd prj&lt;BR /&gt;      mkdir /prj/pscx&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj&lt;BR /&gt;   if [ ! -d /prj/pscx ];then&lt;BR /&gt;      mkdir /prj/pscx/&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj/pscx&lt;BR /&gt;   if [ ! -L /prj/pscx/psc];then&lt;BR /&gt;      ln -s /prj/pscx/ /prj/pscx/psc&lt;BR /&gt;   fi&lt;BR /&gt;   cd /prj/pscx/psc&lt;BR /&gt;   if [ ! -d /prj/pscx/psc/disks ];then&lt;BR /&gt;      mkdir /prj/pscx/psc/disks &lt;BR /&gt;      cd disks&lt;BR /&gt;      if [ ! - L /prj/pscx/psc/disks/disk88 ];then&lt;BR /&gt;         ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disk88&lt;BR /&gt;      fi&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;However, it does not create the symbolic link /prj/pscx/psc/disks/disk88. It only creates until /prj/pscx/psc/disks. &lt;BR /&gt;&lt;BR /&gt;Moreover, how do I get the directory /prj/pscx/psc/disks to be created under /prj/pscx/psc, which is only a link? (Don't ask what this link is for - user's request which cannot be refused)&lt;BR /&gt;&lt;BR /&gt;Currently, it only creates /prj/pscx/psc/disks under /prj/pscx as /prj/pscx/psc points to itself i.e /prj/pscx/psc.&lt;BR /&gt;&lt;BR /&gt;Could someone kindly help me out? Or show me how the script should have been done properly?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Nov 2002 14:21:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847840#M92646</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-11-19T14:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847841#M92647</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;In your script are some syntax errors, e.g. in the first line&lt;BR /&gt;!#/bin/sh    has to be&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;The following script works and it creates the symbolik link /prj/pscx/psc/disks/disk88&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for i in `cat machine_list`&lt;BR /&gt;do&lt;BR /&gt;if [ ! -d /prj ];then&lt;BR /&gt;mkdir /prj&lt;BR /&gt;cd /prj&lt;BR /&gt;mkdir /prj/pscx&lt;BR /&gt;fi&lt;BR /&gt;cd /prj&lt;BR /&gt;if [ ! -d /prj/pscx ];then&lt;BR /&gt;mkdir /prj/pscx/&lt;BR /&gt;fi&lt;BR /&gt;cd /prj/pscx&lt;BR /&gt;if [ ! -L /prj/pscx/psc ];then&lt;BR /&gt;ln -s /prj/pscx/ /prj/pscx/psc&lt;BR /&gt;fi&lt;BR /&gt;cd /prj/pscx/psc&lt;BR /&gt;if [ ! -d /prj/pscx/psc/disks ];then&lt;BR /&gt;mkdir /prj/pscx/psc/disks&lt;BR /&gt;cd disks&lt;BR /&gt;if [ ! -L /prj/pscx/psc/disks/disk88 ];then&lt;BR /&gt;ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disk88&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Try it and let me know if this script does the job.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 19 Nov 2002 14:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847841#M92647</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-11-19T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847842#M92648</link>
      <description>the existence entry for the directory including 'disk88' has a space between the - and the L.&lt;BR /&gt;&lt;BR /&gt;The previous occurence of a "-L" test has no space between these.&lt;BR /&gt;&lt;BR /&gt;Try it and see. &lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Tue, 19 Nov 2002 14:39:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847842#M92648</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-11-19T14:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847843#M92649</link>
      <description>if [ ! -d /prj/pscx ];then                               &lt;BR /&gt;    mkdir -p /prj/pscx/                                  &lt;BR /&gt;fi                                                       &lt;BR /&gt;cd /prj/pscx                                             &lt;BR /&gt;if [ ! -L /prj/pscx/psc ];then                           &lt;BR /&gt;    ln -s /prj/pscx/ /prj/pscx/psc                       &lt;BR /&gt;fi                                                       &lt;BR /&gt;cd /prj/pscx/psc                                         &lt;BR /&gt;if [ ! -d /prj/pscx/psc/disks ];then                     &lt;BR /&gt;    mkdir /prj/pscx/psc/disks                            &lt;BR /&gt;    cd disks                                             &lt;BR /&gt;    if [ ! -L /prj/pscx/psc/disks/disk88 ];then          &lt;BR /&gt;        ln -s /pgfs1/disk88 /prj/pscx/psc/disks/disk88   &lt;BR /&gt;    else                                                 &lt;BR /&gt;    fi                                                   &lt;BR /&gt;fi                                                       &lt;BR /&gt;</description>
      <pubDate>Tue, 19 Nov 2002 14:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-problem/m-p/2847843#M92649</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-11-19T14:48:13Z</dc:date>
    </item>
  </channel>
</rss>

