<?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: Shell Puzzle in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677075#M907526</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ls -b|while read line&lt;BR /&gt;do&lt;BR /&gt;echo filename \"$line\"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Then you have the names neatly between brackets&lt;BR /&gt;and can use the data&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;             Steve Steel</description>
    <pubDate>Wed, 06 Mar 2002 12:08:27 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2002-03-06T12:08:27Z</dc:date>
    <item>
      <title>Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677070#M907521</link>
      <description>Hi All, &lt;BR /&gt;in our Unix-Class here, s'one came up with this idea: &lt;BR /&gt;&lt;BR /&gt;touch "    "&lt;BR /&gt;touch " "&lt;BR /&gt;&lt;BR /&gt;So, now we have two files, each with only whitespaces in their name. How can we: &lt;BR /&gt;1) access each file selectively&lt;BR /&gt;2) make the whitespaces visible &lt;BR /&gt;&lt;BR /&gt;ls -b does not do the trick, as whitespaces are not "non-printing" as such. &lt;BR /&gt;&lt;BR /&gt;Anyone ever run into this ? &lt;BR /&gt;&lt;BR /&gt;Regards &lt;BR /&gt;Dan</description>
      <pubDate>Wed, 06 Mar 2002 11:47:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677070#M907521</guid>
      <dc:creator>Dan Am</dc:creator>
      <dc:date>2002-03-06T11:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677071#M907522</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you call the files with the vi- command, it shows the file name in the left bottom corner marked with ""- characters.&lt;BR /&gt;&lt;BR /&gt;filename " "&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Wed, 06 Mar 2002 11:50:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677071#M907522</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-03-06T11:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677072#M907523</link>
      <description>You should use the inode number that can be found with ls -i&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Federico</description>
      <pubDate>Wed, 06 Mar 2002 11:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677072#M907523</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2002-03-06T11:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677073#M907524</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sorry, i forgot to mention how to access the files:&lt;BR /&gt;&lt;BR /&gt;ls -l " " in the directory or:&lt;BR /&gt;&lt;BR /&gt;ls -l /path_to_file/" "&lt;BR /&gt;&lt;BR /&gt;rm /path_to_file/" "&lt;BR /&gt;rm ./" "&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright site of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Wed, 06 Mar 2002 11:56:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677073#M907524</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-03-06T11:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677074#M907525</link>
      <description>Funny, the forum machine did not actually process this richt either: &lt;BR /&gt;&lt;BR /&gt;The first filename is 4 Whitespaces. &lt;BR /&gt;The second is 1 Whitespace. &lt;BR /&gt;&lt;BR /&gt;Which makes it kind of hard. &lt;BR /&gt;How do do I handle a file by Inode Number ? &lt;BR /&gt;&lt;BR /&gt;Regrds &lt;BR /&gt;Dan</description>
      <pubDate>Wed, 06 Mar 2002 12:05:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677074#M907525</guid>
      <dc:creator>Dan Am</dc:creator>
      <dc:date>2002-03-06T12:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677075#M907526</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ls -b|while read line&lt;BR /&gt;do&lt;BR /&gt;echo filename \"$line\"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Then you have the names neatly between brackets&lt;BR /&gt;and can use the data&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;             Steve Steel</description>
      <pubDate>Wed, 06 Mar 2002 12:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677075#M907526</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-03-06T12:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677076#M907527</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Do the following things &amp;amp; see its output. You can use backslash (\) for special characters like blank spaces etc. &lt;BR /&gt;&lt;BR /&gt;touch " "&lt;BR /&gt;&lt;BR /&gt;echo "hello" &amp;gt;&amp;gt; \&lt;SPACE&gt;&lt;BR /&gt;&lt;BR /&gt;cat \&lt;SPACE&gt; or vi \&lt;SPACE&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Vasu&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;</description>
      <pubDate>Wed, 06 Mar 2002 12:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677076#M907527</guid>
      <dc:creator>Vasudevan MV</dc:creator>
      <dc:date>2002-03-06T12:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677077#M907528</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this command:&lt;BR /&gt;&lt;BR /&gt;cat/more /path_to_file/"    "&lt;BR /&gt;cat/more /path_to_file/" "&lt;BR /&gt;&lt;BR /&gt;or the same syntax with each command. You simply have to quote the space characters.&lt;BR /&gt;If you want to find out, how many space- characters are in the name, use the following command:&lt;BR /&gt;&lt;BR /&gt;vi /path_to_file/" *"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Wed, 06 Mar 2002 12:14:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677077#M907528</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-03-06T12:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677078#M907529</link>
      <description>perl -e 'opendir D,".";for(grep/^ /,readdir D){print"rm [$_] ? ";scalar&lt;STDIN&gt;=~m/^[YyJj]/ and unlink$_}'&lt;BR /&gt;&lt;BR /&gt;if you'd put that in a shell, you can arg it, like&lt;BR /&gt;&lt;BR /&gt; # prm \ *&lt;BR /&gt;&lt;BR /&gt;(UNTESTED)&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;opendir D, ".";&lt;BR /&gt;my @files = grep { -f } readdir D;&lt;BR /&gt;&lt;BR /&gt;for (@ARGV){&lt;BR /&gt;   foreach my $f (@files) {&lt;BR /&gt;       $f =~ m/$_/ or next;&lt;BR /&gt;       print "rm [$_] ? ";&lt;BR /&gt;       scalar &lt;STDIN&gt; =~ m/^[YyJj]/ and unlink $_;&lt;BR /&gt;       }&lt;BR /&gt;    }&lt;BR /&gt;&lt;/STDIN&gt;&lt;/STDIN&gt;</description>
      <pubDate>Wed, 06 Mar 2002 12:22:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677078#M907529</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-03-06T12:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677079#M907530</link>
      <description>Hi Dan,&lt;BR /&gt;&lt;BR /&gt;sorry, typo in last posting of mine:&lt;BR /&gt;&lt;BR /&gt;ls -l /path_to_files/" *"&lt;BR /&gt;&lt;BR /&gt;--&amp;gt; lists all files beginnig with a space, you would get two entries&lt;BR /&gt;&lt;BR /&gt;vi /path_to_files/" *" &lt;BR /&gt;&lt;BR /&gt;--&amp;gt; would open all files beginning with a space, one after the other and show you the names with visible spaces&lt;BR /&gt;&lt;BR /&gt;Then, when you know the number of spaces, you can quote the file name when using the needed commands:&lt;BR /&gt;&lt;BR /&gt;cmd "number_of_spaces"&lt;BR /&gt;or&lt;BR /&gt;cmd " *"&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Mar 2002 12:54:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677079#M907530</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-03-06T12:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677080#M907531</link>
      <description>hi guys, &lt;BR /&gt;thanks to you all. vi seems to be the only &lt;BR /&gt;"readymade" solution here. I have not tried the Perl thing. I'll let you know on that. &lt;BR /&gt;Thanks again. &lt;BR /&gt;Regards &lt;BR /&gt;Dan</description>
      <pubDate>Wed, 06 Mar 2002 16:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677080#M907531</guid>
      <dc:creator>Dan Am</dc:creator>
      <dc:date>2002-03-06T16:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677081#M907532</link>
      <description>If you think you might have a filename with spaces, then you can do the following to see them-&lt;BR /&gt;&lt;BR /&gt;ls -1 | sed -e 's/ /?/g'&lt;BR /&gt;&lt;BR /&gt;This will do a ls command a replace any spaces with "?", thus making them visible.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 06 Mar 2002 16:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677081#M907532</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-03-06T16:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677082#M907533</link>
      <description>Hi Dan,&lt;BR /&gt;&lt;BR /&gt;To access the files, quote them:  surround the appropriate number of spaces with "".&lt;BR /&gt;&lt;BR /&gt;To list multiple files beginning with a space:&lt;BR /&gt;ls " "*&lt;BR /&gt;&lt;BR /&gt;Note the asterik is following the quotes, not inside.&lt;BR /&gt;&lt;BR /&gt;To make the spaces visible you could do:&lt;BR /&gt;ls " "* | tr " " .&lt;BR /&gt;The output would be:&lt;BR /&gt;.&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;To see what characters are in the file names:&lt;BR /&gt;ls | od -b&lt;BR /&gt;0000000 040 012 040 040 040 040 012&lt;BR /&gt;0000007&lt;BR /&gt;&lt;BR /&gt;Note 012 is a newline which delimits filenames in this output.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Wed, 06 Mar 2002 16:35:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677082#M907533</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-03-06T16:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677083#M907534</link>
      <description>[I hope that this comes out OK. When posting, 'something' seems to convert multiple spaces to a single one.]&lt;BR /&gt;&lt;BR /&gt;Adding to the other responses:&lt;BR /&gt;&lt;BR /&gt;Let's first make some files *with* a content:&lt;BR /&gt;&lt;BR /&gt;echo one &amp;gt;' '        # One space.&lt;BR /&gt;echo four &amp;gt;'    '    # Four spaces.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; 1) access each file selectively&lt;BR /&gt;&lt;BR /&gt;General:&lt;BR /&gt;&lt;BR /&gt;command './ '        # One space. &lt;BR /&gt;command './    '     # Four spaces.&lt;BR /&gt;&lt;BR /&gt;I.e. for *example*:&lt;BR /&gt;&lt;BR /&gt;$ cat './ '          # One space.&lt;BR /&gt;one&lt;BR /&gt;$ cat './    '       # Four spaces.&lt;BR /&gt;four&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;&amp;gt; 2) make the whitespaces visible&lt;BR /&gt;&lt;BR /&gt;ls -1 | cat -e&lt;BR /&gt; $&lt;BR /&gt;    $&lt;BR /&gt;[other filenames]&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Mar 2002 14:19:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-puzzle/m-p/2677083#M907534</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-03-07T14:19:02Z</dc:date>
    </item>
  </channel>
</rss>

