Skip to content

Commit

Permalink
Typos, new pwd/script location magic
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoMaciolek committed Jun 3, 2015
1 parent 9984c85 commit 0875b7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions misc_fun_commandlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Prepend (10-digit formatted) incrementing numbers
```bash
gmaciolek@testsvr:~$ awk '{printf("%010d %s\n", NR, $0)}'
gmaciolek@testsvr:~$ awk '{printf("%010d %s\n", NR, $0)}'
````
```
Display multiple files w/names "starting with line 1"
````bash
```bash
gmaciolek@testsvr:~$ tail -n +1 foo1 foo1e foo2 foo2e
==> foo1 <==
f1col1line1 f1col2line1 f1col3line1
Expand Down Expand Up @@ -46,3 +46,12 @@ gmaciolek@testsvr:~$ join foo1e foo2e
0000000002 f1col2line2 f1col2line2 f1col3line2 f2col2line2 f2col2line2 f2col3line2
0000000003 f1col2line3 f1col2line3 f1col3line3 f2col2line3 f2col2line3 f2col3line3
```

Find the location of a script itself.
```bash
#!/bin/bash
echo -n "I launch here, "; pwd; echo "but..
cd $(dirname $(readlink -f $0))
echo -n "The actual path to my own executable self is "; pwd
```

0 comments on commit 0875b7d

Please sign in to comment.