iankelling.org
/
git
/
small-misc-bash
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e1828c5
)
improve documentation
author
Ian Kelling
<ian@iankelling.org>
Sat, 11 Feb 2017 04:28:15 +0000
(20:28 -0800)
committer
Ian Kelling
<ian@iankelling.org>
Sat, 11 Feb 2017 04:28:15 +0000
(20:28 -0800)
README
patch
|
blob
|
history
ex
patch
|
blob
|
history
diff --git
a/README
b/README
index c9bfb471abcbf09ea32ff7bd1d97918bf964b554..171d490c4cb03a46aea74fcbe757f120d556f538 100644
(file)
--- a/
README
+++ b/
README
@@
-1,15
+1,15
@@
Utility bash programs
Utility bash programs
-a
ttribute-cp
Copy owner & perms from 1 file to others
+a
cp attribute-cp.
Copy owner & perms from 1 file to others
dircp Copy a directory structure
directory-browser better cd with forward, backward, and history
dircp Copy a directory structure
directory-browser better cd with forward, backward, and history
-ex
tract-all
Extract many types of files
+ex
Extract many types of files
gitget Idempotent git clone/pull
hostmac Get a host's mac address
isdiff Test if FILE1 and FILE2 have the same contents
gitget Idempotent git clone/pull
hostmac Get a host's mac address
isdiff Test if FILE1 and FILE2 have the same contents
-l
s-enhanced
ls -lA with enhanced output
-psg
rep grep ps and output in a nice format
-rmln wrap rm, expanding symlink arguments
+l
l-function
ls -lA with enhanced output
+psg
-function ps grep. Grep output of ps.
+rmln wrap rm,
recursively
expanding symlink arguments
wpm-game Typing speed game
The main documentation is availiable via --help and near the top of the
wpm-game Typing speed game
The main documentation is availiable via --help and near the top of the
diff --git
a/ex
b/ex
index e0ea044c4698753ea6ded729ea3d4ba9617ba1ca..ff8edb77ce5e7f01441166f1209b4b00642ad6b5 100755
(executable)
--- a/
ex
+++ b/
ex
@@
-18,11
+18,9
@@
ex() {
Extract many types of files
Based on their extensions,
Extract many types of files
Based on their extensions,
-7z
bz2 deb gz iso dsc rar rpm tar xz zip sfs & some combinations
.
+7z
[tar.]bz2 deb [tar.]gz iso dsc rar rpm sfs tar xpi [tar.]xz zip Z
.
See source for exact file extensions.
See source for exact file extensions.
-Note: apt-get install dtrx will do the same for
-most of these types, plus some more, I'm going
-to try it out sometime."
+Note: dtrx (package & command) extracts most of these plus some others."
if [[ $1 == --help ]]; then
echo "$help"
if [[ $1 == --help ]]; then
echo "$help"
@@
-30,18
+28,11
@@
to try it out sometime."
local x super
for x in "$@"; do
case "$x" in
local x super
for x in "$@"; do
case "$x" in
- *.tar.bz2 | *.tbz2 ) tar xjf "$x" ;;
- *.tar.gz | *.tgz ) tar xzf "$x" ;;
- *.bz2 ) bunzip2 "$x" ;;
- *.gz ) gunzip "$x" ;;
- *.tar ) tar xf "$x" ;;
- *.zip|*.xpi ) unzip "$x" ;;
- *.Z ) uncompress "$x" ;;
*.7z ) 7za x "$x" ;;
*.7z ) 7za x "$x" ;;
+ *.bz2 ) bunzip2 "$x" ;;
*.deb ) ar x "$x" ;;
*.deb ) ar x "$x" ;;
- *.rpm ) rpm2cpio "$x" | cpio --extract --make-directories ;;
- *.tar.xz ) tar Jxf "$x" ;;
- *.xz) xz -d "$x" ;;
+ *.dsc) dpkg-source -x "$x" ;;
+ *.gz ) gunzip "$x" ;;
*.iso )
local super
if [[ $EUID != 0 ]]; then
*.iso )
local super
if [[ $EUID != 0 ]]; then
@@
-55,10
+46,18
@@
to try it out sometime."
cp -a "$temp_dir"/* "$dir"
$super umount "$temp_dir"
;;
cp -a "$temp_dir"/* "$dir"
$super umount "$temp_dir"
;;
+ *.jar) jar xf "$x" ;;
*.r[0-9][0-9]|*.rar ) unrar x "$x" ;;
*.r[0-9][0-9]|*.rar ) unrar x "$x" ;;
- *.
dsc) dpkg-source -x "$x"
;;
+ *.
rpm ) rpm2cpio "$x" | cpio --extract --make-directories
;;
*.sfs) $super unsquashfs "$x" ;;
*.sfs) $super unsquashfs "$x" ;;
- *.jar) jar xf "$x" ;;
+ *.tar ) tar xf "$x" ;;
+ *.tar.bz2 | *.tbz2 ) tar xjf "$x" ;;
+ *.tar.gz | *.tgz ) tar xzf "$x" ;;
+ *.tar.xz ) tar Jxf "$x" ;;
+ *.xz) xz -d "$x" ;;
+ *.Z ) uncompress "$x" ;;
+ *.zip|*.xpi ) unzip "$x" ;;
+
*) echo "I don't know how to extract $x";;
esac
done
*) echo "I don't know how to extract $x";;
esac
done