Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6741043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:40:42+00:00 2026-05-26T11:40:42+00:00

I have this script: #!/bin/sh du -s */ [^.]*/ | sort -n | while

  • 0

I have this script:

#!/bin/sh
du -s */ [^.]*/ | sort -n | while read a; do echo $a; done | sed -r 's/^ *([ 0-9]{3})([ 0-9]{3})([ 0-9]{3}) *(.*)\/$/\1 \2 \3 \4/'

but for some reason I get this error:

du: cannot access `[^.]*/': No such file or directory

What am I missing? I don’t know what’s wrong with my script.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:40:42+00:00Added an answer on May 26, 2026 at 11:40 am

    Bash doesn’t support regexp as file name patterns by default, only glob.

    Usually, directories that start with . are not included in */. If you want to include the save ones, use .??*/ (excludes . and ..). It’s not perfect (misses .X/) but is good enough most of the time.

    [EDIT] You can enable a subset of regexp with shopt -s extglob (kudos to fered for pointing that out).

    See Bash Extended Globbing for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For testing purposes I have this shell script #!/bin/bash echo $$ find / >/dev/null
I have a script that looks like this #!/bin/bash function something() { echo hello
I have this script #!/bin/sh for i in `ls -R` do echo Changing $i
I have this script called test.sh: #!/bin/bash STR = Hello World echo $STR when
i have this script: #!/bin/bash if [[ -z $1 ]] ; then echo Class
I have this Perl script sitting in the cgi-bin folder of my Apache server:
I have this piece of script : #!/usr/bin/perl use strict; use warnings; use Data::Dumper;
I have this shell script #!/bin/sh ############################################################# # Example startup script for the SecureTrading
For example, i have this simple bash script: #!/bin/sh cd $1; And this cocoa
I have this script #!/bin/bash function labels2 () { awk ' /[0-9]/{ print substr($3,length($3)-11),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.