1
vote
2answers
47 views

Function that interpretes trailing 'n' characters of a word as argument

Is there a way to pass the trailing n characters of a command to a function, so that it executes it as two commands? For example I define my function as abcx and whenever I enter abcxfoo to the ...
0
votes
1answer
106 views

Stop execution of a function after a given time in PHP

I have five exec() functions in my script. I want to set it up so that if a function fails to respond in a given time, the function will be killed and the next function will start its execution. ...
1
vote
0answers
121 views

Plotting timedata in gnuplot

I have a log file (auth.log) where non-relevant lines has been removed. I wish to aggregate lines per hour/day into the plot, meaning that each line that is within the same hour or day is aggregated ...
2
votes
0answers
566 views

Linux Mint 14 Cinnamon - Fn Keys Brightness Level Intervals

I have a question in regards to setting the brightness level on laptop display using the function keys; I have determined that my screen is capable of having it's brightness level set to values 1-10 ...
0
votes
1answer
630 views

My bash script does not find an existing file

I realized a bash script that works on an existing text file located into the same working directory of the script. The script take name of the file to compute through a function parameter. The issue ...
6
votes
1answer
996 views

How do I unset or get rid of a bash function?

If you set or export an environment variable in bash, you can unset it. If you set an alias in bash, you can unalias it. But there doesn't seem to be an unfunction. Consider this (trivial) bash ...
1
vote
1answer
304 views

Shell function parameter

Is there a way to declare and pass parameters for shell functions, like so ? function msg( m ) { read -p "Task #" + m + "done. Press any key to continue }
4
votes
3answers
1k views

How can I invoke a function in bash shell script

I just wonder the distinction calling the function between $(one_function) and one_function in bash shell script. When I set the variable PS1 in ~/.bashrc, I can't invoke the function by one_func ...