style
This commit is contained in:
parent
643886a7c9
commit
08a9db0554
1 changed files with 1 additions and 9 deletions
|
@ -1,16 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -z "$1" ]; then
|
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
||||||
echo usage: rotdir regex 2>&1
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
ed -s <<EOF
|
ed -s <<EOF
|
||||||
# Read in all files in the current dir
|
|
||||||
r !find "$PWD" -maxdepth 1
|
r !find "$PWD" -maxdepth 1
|
||||||
# Search all lines for regex, move to top
|
|
||||||
g/$1/m0
|
g/$1/m0
|
||||||
# Print all lines
|
|
||||||
,p
|
,p
|
||||||
# Force quit
|
|
||||||
Q
|
Q
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in a new issue