3
votes
4answers
294 views

Bash aliases/functions and command line options

I want to set an alias to start nedit together with command line option -noautosave (due to text files up to 500MB). What seemed to be easy: alias nn="nedit -noautosave $1 &" just raises some ...
2
votes
2answers
76 views

Color PS1 based on previous command output [duplicate]

I have my current PS1 as follows. The $? output is really useful (second line). export PS1="\ ${PSOn_Blue}${PSBWhite}\t\ ${PSColor_Off} \$?\ ${PSColor_Off}${PSBGreen} \u\ ${PSColor_Off}${PSWhite}@\ ...
7
votes
7answers
3k 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 ...