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

  • SEARCH
  • Home
  • 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 6587555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:55:55+00:00 2026-05-25T16:55:55+00:00

I am supposed to make a script that prints all sizes and file-names in

  • 0

I am supposed to make a script that prints all sizes and file-names in the current directory, ordered by size, using the “set” command.

#!/bin/bash

touch /tmp/unsorted

IFS='@'
export IFS

ls -l | tr -s " " "@" | sed '1d' > /tmp/tempLS

while read line
do
    ##set probably goes here##
    echo $5 $9 >> /tmp/unsorted
done < /tmp/tempLS

sort -n /tmp/unsorted
rm -rf /tmp/unsorted

By logic, this is the script that should work, but it produces only blank lines.
After discussion with my classmates, we think that the “set” command must go first in the while loop. The problem is that we cant understand what the “set” command does, and how to use it. Please help. Thank you.

  • 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-25T16:55:55+00:00Added an answer on May 25, 2026 at 4:55 pm
    ls -l | while read line; do
      set - $line
      echo $5 $9
    done | sort -n
    

    or simply

    ls -l | awk '{print $5, $9}' | sort -n
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this python script which is supposed to wrap all that look like
It seems to me that introducing an ORM tool is supposed to make your
I'm trying to design this script that's supposed to be used as a part
I've written a small script in Python that pings all subnets of my school's
I have an htaccess file that is supposed to be redirecting any non-existing files/folders/etc
My script is supposed to wait for the "Select File" dialog of IE to
I'm writing a python script that is supposed to manage my running files. I
Suppose I have an element called #container-main . How do I make that display:none
Suppose this is my URL route: (r'^test/?$','hello.life.views.test'), How do I make it so that
Can you make file copying faster through multiple threading? Edit : To clarify, suppose

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.