Tagged Questions
4
votes
1answer
74 views
View shell function's current definition
So I am editing bashrc constantly, and I have a terminal open with a working function definition, although bashrc has been updated with a wrong function definition. (Because the definition do not ...
2
votes
2answers
93 views
Is there any way I can fit this into my ~/.bashrc as a function?
I just discovered this useful bit of code on this useful-looking website.
#!/bin/sh
exec tclsh "$0" ${1+"$@"}
proc main {} {
set lines [lrange [split [read stdin] \n] 0 end-1]
set count ...
7
votes
7answers
623 views
Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)
Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like
echo 'scale=25;65320/670' | bc
but ...