Project

oct

0.0
No commit activity in last 3 years
No release in over 3 years
Command line octal file permissions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 0.4.5
>= 1.0.14
~> 1.1.9
~> 0.9.2
~> 2.9.0

Runtime

 Project Readme

Oct

Command line octal file permissions

Why?

Oct is a sample RubyGem application cloned from BasicApp. See http://github.com/robertwahler/basic_app for more information.

Oct does scratch an itch. 'Chmod' is easier to drive in octal and I can't convince 'ls -l' to output permissions in octal.

Here is an equivalent bash script

#!/bin/bash
# octal file listing

if [ "$1" == "" ]
then
  PARAM="*"
else
  PARAM="$@"
fi

for file in $PARAM
do

  if [ ! -e "$file" ]       # Check if file exists.
  then
    echo "$file does not exist."; echo
    continue                # On to next.
   fi

   stat --format='%a,%U,%G,%t %n' $file
done

Run-time dependencies

Development dependencies

Installation

This gem has been published on RubyGems.org

gem install oct

Usage

oct --help

Octal file listing

  Usage: oct [options] [FILES]

Options:

    -v, --[no-]verbose               Run verbosely
    -c, --[no-]coloring              Ansi color in output
        --version                    Display current version
    -h, --help                       Show this message

Example

ls -l

total 0
-rw-r--r-- 1 robert robert 0 2010-03-12 10:37 file1.txt
-rw-r--r-- 1 robert robert 0 2010-03-12 10:37 file2.txt

oct

0644 file1.txt
0644 file2.txt

Copyright

Copyright (c) 2010-2017 GearheadForHire, LLC. See LICENSE for details.