The tag has no usage guidance.

learn more… | top users | synonyms (1)

13
votes
5answers
2k views

Finding the definition of a bash function

I work in an environment that has a lot of legacy shell script magic lying around. One thing used heavy from the command line are bash functions that get sourced from some file included from some ...
12
votes
4answers
18k views

How to call bash functions

Maybe I am looking at this the wrong way.. But here I what I am trying to do. Do most of my work with Java but just switched to a unix (bash) environment. I am doing this: [~/Desktop/bashPlay]% ...
9
votes
1answer
2k 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 ...
5
votes
1answer
2k views

overriding user defined functions with the same name as system commands

This function exists in one of my users' ~/.bashrc: function rm() { ls $* echo "rm?" read ans if [ "$ans" == 'y' ]; then /bin/rm $* fi } In ...
5
votes
4answers
15k views

Excel VBA Function runtime error 1004: Application-defined or object-defined error

I'm trying to learn functions for the purpose of simplifying and reusing code whenever necessary. I began by turning something I use pretty often into a function: Returning the integer value of the ...
4
votes
3answers
17k views

Change middle mouse button function in Windows

Is there a way to assign a function (like cut/copy/paste) to the middle mouse button or scroll wheel in Windows 7?
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 ...
4
votes
2answers
8k views

Excel - define a formula in one cell to be used in other cells with different inputs like a function

I use excel 2010. I want to use a formula defined in one cell as if it was a user-defined function. Example: In A1 I put something like (I know it's not a real syntax): = 3 * Input + 15 And then ...
4
votes
1answer
744 views

ms excel find and replace @ symbol results in broken formula

I'm trying to search and replace in excel, the column is formatted as 'Text'. Find: [@ replace with: @ Whenever this finds a match at the start of a cell i.e the cell contents start with [@ and ...
4
votes
1answer
60 views

Taking an indirect reference in Excel and making it a direct reference

For many somewhat complicated reasons – it has to do with transposing columns and rows because of third party software limitations, etc. – I have had to use the INDIRECT function in order to make ...
3
votes
3answers
5k views

How can I switch the function and control keys on my laptop?

I have an ASUS X51R laptop and the left function/control keys are swapped as shown in the picture below? Is there some way to remap these keys so that CTRL is on the far left as on a standard ...
3
votes
1answer
508 views

Function which overrides bash command

Is it possible to call a bash command which has been overridden with a function? I'd like to make pushd with no arguments alias to pushd . otherwise get normal behaviour. I've tried pushd(){ if [ ...
3
votes
3answers
7k views

Can basic mathematics be done in Microsoft Word?

Is there a function of MS Word that enables users to solve basic math problems, in this case addition or subtraction? I use its platform for a budget and of course I could just use a calculator but it ...
3
votes
2answers
137 views

How can I get the place where a function is defined in VIM quickly?

I've installed taglist and nerdtree plugins, and I wonder if there's way to quickly find the location where some function is defined, just as what Control and pressing function name in Eclipse does? ...
3
votes
1answer
4k views

OpenOffice Calc - how to insert BLANK in a formula?

In Calc, as in most spreadsheet applications, an IF() function exists that can be used to control behaviour, for example inserting this formula in cell C1. =IF(A1>B1;"A";"B") will display A in ...
3
votes
1answer
11k views

Combining two IF functions in one cell using Excel 2010

I have these two IF functions that work correctly on their own. I need to combine the two into one cell but can't seem to get them to work. Any help would be appreciated. And thanks in advance. ...
3
votes
0answers
1k views

How to add support in Function List for a new user-defined language? (Notepad++ Win7 64bit)

I'm writing in a user-defined language called 'Umajin' (*.u), which has a syntax quite different from C/C++ or any ECMAScript-based language, so we've had to write in the rules for the highlighting. ...
2
votes
2answers
40 views

How to create a data series for exponential decrease diagram

I want to create a pricing model this way: If you need this product for 50 people, you should pay 2500 (units) per person. . . . . If you need this product for 10,000 people, you should pay 300 ...
2
votes
1answer
55 views

Function using watch on command with command line arguments

I want to run watch on a command which uses an optional command line argument, like this: function queue() { watch -n 10 'squeue -p ${1:-default} -o "%.8i" ' } but the command-line argument ...
2
votes
1answer
1k views

Excel: Reverse VLOOKUP with comparaison

I have an original table (the value column is sorted): name | id | value --------+-------+------- abc | 1 | 12 def | 2 | 15 ghi | 3 | 23 jkl | 4 | 29 ...
2
votes
1answer
1k views

How to return current record number in Access?

I want to have my table to automatically returns current record number. What functions should I input in default value of this field (indicated in blue arrow) in order to automatically generates ...
2
votes
2answers
1k views

Excel Table lookup with indexes in multiple columns

I have a Table in Excel the looks about like this: Test1 100 test2 200 Test3 110 test4 210 Test5 120 test6 220 I want a function that, given test 1 as input, will return 100 AND given ...
2
votes
1answer
93 views

How to save user made zsh shell functions and aliases

Shell beginner here! I'd like to create aliases and functions in zsh shell to speed up my workflow. For example: tw() { open -a //Applications/Textwrangler.app "$*"; } The function itself works, ...
2
votes
1answer
1k views

Excel formula for one cell to repeat across a different column (perhaps IF command)

I'm wanting to look up if a series of values (Column N) fall within a specified range. Currently trying this: =IF(AND(N:N<=C2,N:N >=L2),"YES","NO") This does not properly work. I want to ...
2
votes
2answers
5k views

Turn off laptop back light without keyboard in Windows 7

How do I turn off my laptop's back light using a shortcut, or a program in Windows 7? I have a Gateway NV59 and can press Fn + F8 to blacken the screen. At night, while watching a movie on my other ...
2
votes
1answer
36 views

Creating a line graph in excel with changing/result cells

For a project we are creating care packages for the homeless. I am trying to figure how many kits to make for the least leftover material as the things we are putting into the packages are sold in ...
2
votes
1answer
60 views

Use Excel to match data from a cell on a worksheet, then copy data from its neighboring column and paste on a different worksheet

I have a spreadsheet with multiple names and phone numbers next to them in each Sheet 1 - Sheet 5. Each Sheet has about 900 names on column A and their associated phone numbers next to them on column ...
2
votes
1answer
125 views

Export bash function over SSH

I would like to export a bash function over ssh to use it in GNU parallel. That question seems to be answered here Exporting bash functions through ssh but I don't seem to be able to get it to work. ...
2
votes
0answers
734 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 ...
2
votes
2answers
71 views

Rename selfdefined function

Having a precmd() that does quite a lot, like checking for VCS information, I want to disable it when I'm navigating on slow mounted network drives. I came up with the following with which I can say ...
2
votes
3answers
345 views

How do I make a bash alias that outputs file names in a format I can pipe to vim?

When rebasing with git, I'm interested to open the files that have merge conflicts. I can do this with: vi `git diff --name-status --diff-filter=U | awk '{print $2}'` but if I alias that: alias ...
1
vote
3answers
1k views

How do I handle the failure of a command in a bash function?

I have a bash function on one of our test servers that deploys our code, but one of the commands fails frequently and we can't find the cause. We just retry until it works. I want to have the ...
1
vote
2answers
69 views

Why is my constructed formula giving different results than the same formula as UDF in Excel?

Here's a long formula to calculate distance between two coordinates points on Earth =ACOS(COS(RADIANS(90-LAT1)) *COS(RADIANS(90-LAT2)) +SIN(RADIANS(90-LAT1)) *SIN(RADIANS(90-LAT2)) ...
1
vote
1answer
680 views

Call on a cell in Excel up to the first semi-colon

I am using the =CONCATENATE function, and one of the cells I'm calling on I only want to take the value in the cell up to the first semi-colon. Is this possible, and if so how?
1
vote
2answers
617 views

Excel macro date parser cannot handle single-digit days

From previous questions on this and other sites I was given a function that can parse for and find dates in text strings or cells. Here's the function: Function GetDate(strInput As String) As Date ...
1
vote
3answers
970 views

Regular keyboard stuck as if a laptop function key was pressed

I have a regular PC keyboard plugged in a desktop PC with Windows 7 When I switched on the computer today I discovered that pressing U writes '4', O writes '5', K writes '2', etc. exactly as if you ...
1
vote
2answers
56 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 ...
1
vote
1answer
2k views

Returning The Name of the highest value field

I have 4 field of Numeric Values, I want Excel To pick the highest value of them and show me the name of the field that is related to the highest one, for example: Option 1 (J10) Option2 (K10) ...
1
vote
2answers
7k views

Quicker alternative to IF function for multiple variables? (excel 2010)

I have the following information in a table C D ----------- ----------- 1 | 25% | 1 | ----------- ----------- 2 | 50% | 2 | ----------- ...
1
vote
3answers
8k views

Does Excel have a row filtering function (more general version of SUMIF/COUNTIF)

SUMIF and COUNTIF functions are handy for simple SUM and COUNT operations on only some of the values in a range, but is there a more general version that would allow me to plug in any other function I ...
1
vote
1answer
177 views

Replicating common Excel Functions

I am always curious how some of the functions I use in excel were written, and think it would help at times to see how it was done. Does anyone know where there is example vba that replicates what ...
1
vote
1answer
323 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 }
1
vote
1answer
137 views

Return the date of the day under an if formula with Excel or VBA

I have two columns A and B and many lines with some specific tasks to be done. In column B, I have a drop-down list with the name of people who are scheduled for the task . And in column A, I want the ...
1
vote
2answers
72 views

Vim Avoid “Hit the enter key or enter a command”

I have the following configuration in my .vimrc file to switch between a .c File and it's corresponding .h File function SwitchHeader() w if(&ft=='cpp') e %:r.c ...
1
vote
1answer
4k views

How to create an Excel SUMIF formula that can compare different date formats

For my source data I have a column of dates in the dd/mm/dddd format, and a column of values next to it. eg 03/02/2014 5 17/02/2014 4 03/03/2014 5 17/03/2014 4 On a summary sheet I have a ...
1
vote
1answer
907 views

Passing parameters to python -c inside a bash function?

I need to print the value of a Django setting while in a Bash shell. Basically, the command I'd like to run is python -c 'from django.conf import settings; print settings.MEDIA_ROOT'. I need to be in ...
1
vote
1answer
219 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 ...
1
vote
2answers
13k views

Excel- If multiple cells in a range are blank, return an answer

In Excel (365 edition), I want to have a formula determine whether in a range of 5 cells, 3 of those cells are blank. If there are 3 cells, I want it to display INELIGIBLE, if there are fewer than 3 ...
1
vote
1answer
538 views

Exporting bash functions through ssh

So I found a way to transfer environment variables through ssh without having to change neither server nor client: Transferring environment variable through SSH / quoting in bash/sh/csh/tcsh But I ...
1
vote
3answers
696 views

Using a pre-existing function for a new row

I have an Excel document that contains X columns and N number of rows. The very last column of a row performs a SUM of the first X-1 columns. The problem I have is, the user of this Excel document ...