Macworld Forums: February 2004's "Unix tip of the month" - Macworld Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

February 2004's "Unix tip of the month"

#1 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 11 January 2004 - 08:03 PM

As written, this tip will not work in 10.3. It should read:
code:
du -hc "`find . -name "content_index" -print`"


Note, it should have used "`" instead of "'". Additionally, this command doesn't work in bash. You will get "File name too long" error. To rectify this, simply use the command:
code:
tcsh


This will get you into the tcsh shell. Now the command will work as advertised.

#2 User is offline   Nobody Icon

  • Power User
  • PipPipPipPip
  • Group: Members
  • Posts: 58,347
  • Joined: 18-October 07

Posted 12 January 2004 - 12:04 AM

My hero.
>swoon<
It's not TV -- it's H2U
0

#3 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 12 January 2004 - 04:09 AM

<johnwayne>Well, you're welcome, little lady.</johnwayne>
/forums/ubbthreads/images/graemlins/tongue.gif

#4 User is offline   prudhaa Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 21-August 03

Posted 12 January 2004 - 07:38 AM

The tip didn't work for me in 10.2 either -- it's the ' versus ` thing apparently. As a total novice to Unix, I had no chance to make it work. Also had to search the keyboard to even find ` !
Worked with the change. Thanks.
0

#5 User is offline   Mac-Ale Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 298
  • Joined: 03-August 01

Posted 12 January 2004 - 09:42 AM

Geeks... /forums/ubbthreads/images/graemlins/grin.gif
And I can't remember any of the PASCAL I learned in 1982...
0

#6 User is offline   Duke_Thomas Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 757
  • Joined: 25-May 01

Posted 12 January 2004 - 10:32 AM

code:
du -hc "`find . -name "contentindex" -print`"



Are you sure? This does not work for me in bash or in tcsh. Moreover, I cannot see how it could possibly work ... if there is more than one file, enclosing the command substitution within ""s will say "no word splitting," and you'll get the word too long error either way, or at least file not found. The following, however, works in both tcsh and bash under 10.3.

code:
du -hc `"find . -name contentindex"`


0

#7 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 12 January 2004 - 10:46 AM

Worked for me. Not sure what to tell you. Maybe you finked some of your commands or shells? If the second command works for both shells, then it's better.

#8 User is offline   Duke_Thomas Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 757
  • Joined: 25-May 01

Posted 12 January 2004 - 12:04 PM

In reply to:

Maybe you finked some of your commands or shells?


That's not the problem. Actually, my way doesn't work in either shell actually, and your way works just dandily in tcsh exactly as you wrote it. I blame -- God, I have nothing to blame, do I? Plenty of sleep, plenty to eat. I'm going senile before my time. /forums/ubbthreads/images/graemlins/blush.gif Sorry. /forums/ubbthreads/images/graemlins/laugh.gif
0

#9 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 12 January 2004 - 01:05 PM

First you go after Jason for the download section, then you try to go after me for something correct. You out to get us Duke? /forums/ubbthreads/images/graemlins/wink.gif /forums/ubbthreads/images/graemlins/cool.gif

#10 User is offline   dcipjr Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,197
  • Joined: 09-January 01

Posted 13 January 2004 - 10:27 AM

I haven't gotten my issue yet. What does this tip do?
0

#11 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 13 January 2004 - 10:34 AM

It's an updated version of the trimming Mail's mailbox files by deleting the index files.

#12 User is offline   Jon Seff Icon

  • Advanced Member
  • Icon
  • Group: Moderators
  • Posts: 1,080
  • Joined: 13-December 00

Posted 13 January 2004 - 01:54 PM

You are correct d00d - we printed the wrong character. Thanks for pointing it out.

#13 User is offline   griffman Icon

  • Advanced Member
  • Icon
  • Group: Moderators
  • Posts: 8,605
  • Joined: 09-January 01

Posted 13 January 2004 - 02:31 PM

Some of this goes on my shoulders, too -- I had the proper backtick in the master document I sent in (which is why this thread confused me; d00d's original "correction" matched what I had in my original file!), but I didn't catch that it got converted to a straight quote when I proofread the final PDF. Sorry, and thanks d00d!
-rob.

#14 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 13 January 2004 - 05:15 PM

No problem griff. I figured that's what happened. The screenshot gives away the real answer anyway.

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

3 User(s) are reading this topic
0 members, 3 guests, 0 anonymous users