The tag has no wiki summary.

learn more… | top users | synonyms (1)

13
votes
5answers
1k 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
16k 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]% ...
7
votes
1answer
1k 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
1k 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
13k 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
2answers
14k 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
1answer
657 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 ...
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
484 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
5k 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
7k 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 ...
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
8k 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. ...
3
votes
1answer
32 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 ...
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
25 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
990 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
99 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
707 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
60 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
332 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
983 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
1answer
574 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
583 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
905 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
55 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
1k 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
6k 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
6k 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
176 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
133 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
46 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
3k 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
786 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
2answers
9k 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
480 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
629 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 ...
1
vote
1answer
6k views

AutoHotKey how to pass/evaluate parameters to functions

I'm having trouble understanding how parameters are accessed in AutoHotKey functions. For example, I set myVar variable with the InputBox, then pass it to a function. How do I evaluate the arg in the ...
1
vote
1answer
879 views

Changing numpad key function when numlock is off?

So I've got a new Acer notebook and the keyboard is laid out like this: I want to be able to change the left and right arrows of the numpad to volume down and up and the 5 key to mute but still be ...
1
vote
2answers
337 views

Conditional Lookup in Excel

I want to use excel to compare pairs of numbers from the "Pre/Post" column of the following data: Student Course Pre/Post Score K300997203 FHS120100417 Pre 3 L286197217 ...
1
vote
3answers
14k views

How do I assign a number value to a non-numerical value in Excel

I have some survey responses with values like "VU" for "Very Unlikely" and "S" for Sometimes. Each survey response occupies a cell. For each cell containing a survey response, I want to fill another ...
1
vote
3answers
647 views

Access 2007: How can I make this EXPRESSION less complex?

Access is telling me that my new expression is to complex. It used to work when we had 10 service levels, but now we have 19! Great! My expression is checking the COST of our services in the ...
1
vote
1answer
29 views

I am trying to use the if function to look at cells to the left and leave the cell blank if they are blank or calculate if they are not

I am trying to use the if function to look at cells to the left and leave the cell blank if the reference cells are blank or calculate if they are not. for example I have E14 that im putting the ...