Mobile version of this page
Previous:
Lesson learnt with creating DOM element with jQuery
Next:
Mixing in new-style classes in Zope 2.7
Catching a carriage return in bash
Read in passwords with bash
FacebookStatusUpdater
ztar - my wrapper on tar -z
type - Writing shell scripts
Lesson learnt with creating DOM element with jQuery
Next:
Mixing in new-style classes in Zope 2.7
Related blogs
File check before deleteCatching a carriage return in bash
Read in passwords with bash
FacebookStatusUpdater
ztar - my wrapper on tar -z
type - Writing shell scripts
Related by category
pwdf - a mix of ls and pwd
bash script, pwd, pwdf, bash
7th of April 2008
I often need to know the path to a file so that I can put that in an email for example. The only way I know is to copy and paste the output of pwd followed by a slash / followed by the name of the file. This is too much work so I wrote a quick bash script to combine this into one. Now I can do this:
$ cd bin $ pwdf todo.sh /home/peterbe/bin/todo.sh
I call it pwdf since it's pwd + file. Here's the code for the curious:
#!/bin/bash echo -n `pwd` echo -n '/' echo $1
Is there no easier way built in into Linux already?







Save this page in del.icio.us
If you are using bash, you can use
echo $PWD/todo.sh