<?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 create directory name (with blank spaces) using a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050904#M434775</link>
    <description>I am trying to write a script that will be syncronizing the directory structure of a Samba share from production to DR. The directories are created by Window users and most of them with blank spaces. the problem I am experiencing is that if I use mkdir "file name" from command line, the directory gets created but if I use a script to create the directory, the script creates two directories (file and name). &lt;BR /&gt;&lt;BR /&gt;I am using the find command to create files from both servers and then the diff command to stripe the directories that must be created and deleted based on the DR server based onthe production environment. I am also using the sed command to add double quotes (") to the begining and end of each line of the file and an if statement is used to read the lines and execute the mkdir command for each line.&lt;BR /&gt;&lt;BR /&gt;The problem we are experiencing is that the system is not interpreting the double quotes and multiple directories are getting created. We also tried using double quotes within the FOR I statement (mkdir "$i")as well as backslashes before the blank space (file\ name)with the same results. &lt;BR /&gt;&lt;BR /&gt;Thank you in advance for any help and/or suggestion.</description>
    <pubDate>Mon, 04 Jun 2007 11:52:55 GMT</pubDate>
    <dc:creator>Dario_1</dc:creator>
    <dc:date>2007-06-04T11:52:55Z</dc:date>
    <item>
      <title>create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050904#M434775</link>
      <description>I am trying to write a script that will be syncronizing the directory structure of a Samba share from production to DR. The directories are created by Window users and most of them with blank spaces. the problem I am experiencing is that if I use mkdir "file name" from command line, the directory gets created but if I use a script to create the directory, the script creates two directories (file and name). &lt;BR /&gt;&lt;BR /&gt;I am using the find command to create files from both servers and then the diff command to stripe the directories that must be created and deleted based on the DR server based onthe production environment. I am also using the sed command to add double quotes (") to the begining and end of each line of the file and an if statement is used to read the lines and execute the mkdir command for each line.&lt;BR /&gt;&lt;BR /&gt;The problem we are experiencing is that the system is not interpreting the double quotes and multiple directories are getting created. We also tried using double quotes within the FOR I statement (mkdir "$i")as well as backslashes before the blank space (file\ name)with the same results. &lt;BR /&gt;&lt;BR /&gt;Thank you in advance for any help and/or suggestion.</description>
      <pubDate>Mon, 04 Jun 2007 11:52:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050904#M434775</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T11:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050905#M434776</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Linux example with special chars&lt;BR /&gt;&lt;BR /&gt;Quantum\ Leap\ -\ Season\ 3\ -\ Dvdrip/Quantum\ Leap\ -\ \[3x05\]\ -\ The\ Boogieman\ -\ \(DVDRip\)\ -\ \[Medieval\].avi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Double quote the directory name including spaces.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 04 Jun 2007 12:06:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050905#M434776</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-06-04T12:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050906#M434777</link>
      <description>td176&amp;gt; x='name with spaces'&lt;BR /&gt;td176&amp;gt; mkdir "$x"&lt;BR /&gt;td176&amp;gt; ls -l&lt;BR /&gt;total 8&lt;BR /&gt;drwxrwxrwx   2 antinode   513           4096 Jun  4 13:02 name with spaces&lt;BR /&gt;&lt;BR /&gt;td176&amp;gt; cat md.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;x='name with spaces in script'&lt;BR /&gt;mkdir "$x"&lt;BR /&gt;&lt;BR /&gt;td176&amp;gt; ./md.sh&lt;BR /&gt;&lt;BR /&gt;td176&amp;gt; ls -l&lt;BR /&gt;total 24&lt;BR /&gt;-rwxrwxrwx   1 antinode   513             52 Jun  4 13:06 md.sh&lt;BR /&gt;drwxrwxrwx   2 antinode   513           4096 Jun  4 13:02 name with spaces&lt;BR /&gt;drwxrwxrwx   2 antinode   513           4096 Jun  4 13:06 name with spaces in script&lt;BR /&gt;&lt;BR /&gt;It might help if you showed a simple example&lt;BR /&gt;of what you're doing.  Vague descriptions are&lt;BR /&gt;not as good.</description>
      <pubDate>Mon, 04 Jun 2007 12:07:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050906#M434777</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-06-04T12:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050907#M434778</link>
      <description>w/o seeing the actual script, I'd have to guess that you are doing something like&lt;BR /&gt;&lt;BR /&gt;for i in $somevar&lt;BR /&gt;do&lt;BR /&gt;  mkdir $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;the i will be the first word "file" the first time thru, "name" the second in this case.&lt;BR /&gt;&lt;BR /&gt;as snippet of the script, and its input would be helpful</description>
      <pubDate>Mon, 04 Jun 2007 12:11:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050907#M434778</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-06-04T12:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050908#M434779</link>
      <description>Seems like most folks can create a dir with embedded spaces in it using a script. So could you post your script here so that it can be looked at.&lt;BR /&gt;&lt;BR /&gt;~thanks</description>
      <pubDate>Mon, 04 Jun 2007 12:15:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050908#M434779</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-06-04T12:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050909#M434780</link>
      <description>It's actually trivially simple:&lt;BR /&gt;&lt;BR /&gt;A="Clay Dir"&lt;BR /&gt;mkdir "${A}"&lt;BR /&gt;&lt;BR /&gt;The key is to double quote everywhere.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Jun 2007 12:15:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050909#M434780</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-04T12:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050910#M434781</link>
      <description>First off, it'd probably be a lot easier to use rsync for this than write some complicated script to handle the task.&lt;BR /&gt;&lt;BR /&gt;However, going along with your script attempt, it would be a little easier to troubleshoot your script if you showed the actual code you're trying to use. However, based on your description and the mention of a FOR loop, I'll guess you're doing something like:&lt;BR /&gt;&lt;BR /&gt;for I in $(find /dir -type d)&lt;BR /&gt;do&lt;BR /&gt;mkdir "${I}"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Your problem would be that the find command is going to generate a list of directories and the FOR statement is going to take all those spaces in the directory names as separators for unique values to use for I. No matter how you quote or escape within the loop, the results will always be the same.&lt;BR /&gt;&lt;BR /&gt;One option offhand would be dump the find output to a file and use the file as input to a while loop:&lt;BR /&gt;&lt;BR /&gt;find /dir -type d &amp;gt; mkdir.tmp&lt;BR /&gt;while read I&lt;BR /&gt;do&lt;BR /&gt;mkdir "${I}"&lt;BR /&gt;done &amp;lt; mkdir.tmp</description>
      <pubDate>Mon, 04 Jun 2007 12:16:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050910#M434781</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2007-06-04T12:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050911#M434782</link>
      <description>Wow! The script was not ready, I was using pieces to see if I was going to be able to make it work. I created the preliminary part of the script, which I will modified later but you will be able to get a better idea of what's happening. &lt;BR /&gt;&lt;BR /&gt;Rsync and rdist are not going to be used because there are close to 4,000 files and we won't need those files there. The application will only need directory structure. &lt;BR /&gt;&lt;BR /&gt;I will be replying with both file outputs shortly.&lt;BR /&gt;&lt;BR /&gt;thank you for your help.</description>
      <pubDate>Mon, 04 Jun 2007 12:46:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050911#M434782</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T12:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050912#M434783</link>
      <description>File containing directories to be deleted from DR.</description>
      <pubDate>Mon, 04 Jun 2007 12:47:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050912#M434783</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T12:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050913#M434784</link>
      <description>File containing directories to be created in DR server.</description>
      <pubDate>Mon, 04 Jun 2007 12:48:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050913#M434784</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T12:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050914#M434785</link>
      <description>I also tried using mkdir "${i}" within the script with the same results.&lt;BR /&gt;&lt;BR /&gt;thx,</description>
      <pubDate>Mon, 04 Jun 2007 12:53:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050914#M434785</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050915#M434786</link>
      <description>Looks like I was right on my guess how you were trying to implement it. Skip the quoting in the input file (dr_samba.dir). Use the construct I mentioned previously with a WHILE loop instead of FOR loop.</description>
      <pubDate>Mon, 04 Jun 2007 13:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050915#M434786</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2007-06-04T13:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050916#M434787</link>
      <description>Ok, this really couldn't be simpler:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset INFILE="/your/file/listing/the directories"&lt;BR /&gt;&lt;BR /&gt;typeset DIRNAME=""&lt;BR /&gt;cat ${INFILE} | while read DIRNAME&lt;BR /&gt;  do&lt;BR /&gt;    mkdir "${DIRNAME}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Jun 2007 13:40:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050916#M434787</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-04T13:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050917#M434788</link>
      <description>Ok, this really couldn't be simpler:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset INFILE="/your/file/listing/the directories"&lt;BR /&gt;&lt;BR /&gt;typeset DIRNAME=""&lt;BR /&gt;cat "${INFILE}" | while read DIRNAME&lt;BR /&gt;  do&lt;BR /&gt;    mkdir "${DIRNAME}"&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;#NOTE that quotes are need even in the cat "${INFILE}" because in my example the file name contains whitespace</description>
      <pubDate>Mon, 04 Jun 2007 13:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050917#M434788</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-04T13:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050918#M434789</link>
      <description>thank you all. Problem has been resolved. I appreciate every answer.</description>
      <pubDate>Mon, 04 Jun 2007 14:09:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050918#M434789</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T14:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: create directory name (with blank spaces) using a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050919#M434790</link>
      <description>thank you again.</description>
      <pubDate>Mon, 04 Jun 2007 14:10:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-directory-name-with-blank-spaces-using-a-script/m-p/5050919#M434790</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2007-06-04T14:10:05Z</dc:date>
    </item>
  </channel>
</rss>

