The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
0answers
43 views

Redirect 'complete' in bash functions and alias

tl;dr: Is there a way to use an existing auto completion function to also auto complete arguments to an alias or short function. Auto completion in bash is great but does not mix well with aliases ...
2
votes
1answer
47 views

Create folder loop function doesn't work

I have created a function in a .sh file that creates directories in a loop with 3 parameters int: start, end and folder name name But I am getting the following error: Syntax error: "(" unexpected ...
11
votes
1answer
294 views

What does _expand do?

I was working with the shell, and by mistake I autocompleted with tab after writing _e, which resulted in _expand. What does this command do? I couldn't find an explanation online, the only ...
3
votes
1answer
44 views

Finding, moving and removing in Ubuntu

OS: Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-62-generic x86_64) I have a directory like the following: ~/total/ test1/ test1.txt some_other_file_i_dont_care.py test2/ ...
0
votes
0answers
8 views

Most of functions disappered from my account (admin).

What might be causing most of Ubuntu functions to disappear from user account? On start up I am reciecing only empty screen with background picture and folders. Computer is barely responding to any ...
0
votes
2answers
194 views

create scatter plot

file (1. arg) will create (scatter plot) for n. column (x-axis, 2. arg) and m. column (y-axis, 3. arg) function is called myfun sourcefile 1 3 for scatter plot of 1. and 3. column from file ...
3
votes
1answer
43 views

How to execute bash aliases functions in the terminal?

I found out that many people have something like in their /etc/bash.bashrc as aliases: del_recursive() { find . | grep '$1' | xargs rm } process() { ps -ef | grep $1 } apache() { sudo ...
1
vote
1answer
36 views

What is the difference between these python functions?

What is the difference between this: def total(initial=10, *numbers, **keywords): count = initial for fake in numbers: count = count + fake for key in keywords: ...
1
vote
0answers
184 views

Textstat not running functions

I just found the link on how to install textstat on my python idle and I was successful in getting it to work. However, when I import textstat everything seems fine until I try to run a function. It ...
0
votes
1answer
26 views

Where are custom functions located

When I in Ubuntu runs the mario(){echo "Sorry, Mario is in another castle";} in the console, where does this gets saved, and how do I remove the function mario?
1
vote
1answer
41 views

How to enter part of a command automatically, after another command executed?

I want to create a function for grep-ing my command line history by history | grep {keyword}. And after seeing the list and choosing the command by line number ,I want to execute it by !{line_number} ...
13
votes
7answers
3k views

How to make the argument as optional in bash?

In below function with 9 arguments: SUM() { echo "The sum is $(($1+$2+$3+$4+$5+$6+$7+$8+$9))" } I want to make the second arguments to the next(3..9) become a optional arguments. When I call ...
0
votes
1answer
43 views

Backup function

I am attempting to make a function that you provide it a file name, it then make a back up of the file and slaps on a time stamp to mark the file. Once it time stamps the file it prints out all files ...
0
votes
2answers
217 views

How can I select all untagged photos in Shotwell?

I would like to be able, to select all untagged and tagged photos in Shotwell separately, so that I may tag and re-tag them. How can I do this?
2
votes
2answers
10k views

How to pass arguments to functions while executing a python script from terminal?

I have a python file named solution.py and I can successfully execute it through the terminal using the following commands: chmod +x solution.py python3 solution.py This works just fine if I have ...
3
votes
2answers
3k views

Num Lock function has changed after upgrading to UBUNTU 13.10 [duplicate]

I faced a strange function I installed ubuntu 13.10 and all the time the number pad on the right of my keyboard is typing number without pressing Num Lock and when I turn it on It does the job when ...
4
votes
2answers
2k views

Where can I put a user-defined shell function?

I am planning to create a function that would simplify things for me. The function would be something like function lazymode() { echo "Hello World!"; } so that when I use the command lazymode in ...
2
votes
2answers
691 views

How to get original system command after overwriting it with a function?

I'm at a Hackathon right now so if someone would answer this soon, you'd be doing me a huge favor. I've written a function called ls() in my .bashrc that looks like this: ls() { if(some ...
9
votes
2answers
12k views

How can I protect parentheses passed to a cd command?

I asked here how to make cd protect spaces. Tab completion is great, but sometimes you paste the path from the clipboard so this is useful. The solution breaks with parentheses however. No matter how ...
3
votes
1answer
300 views

Saw an interesting command but can't alias it

Saw an command from this post http://askubuntu.com/a/266839/75967 that I would like to alias find {,/usr}/{,s}bin -printf '%f\0' | xargs -0 whatis | sort | less I assume the less or the | is ...
1
vote
1answer
151 views

Extending postgresql code

In postgresql source code there is a file called postgres.c precisely in /src/backend/tcop/. Inside there is a function called exec_simple_query. I want add a line that call my_function that is in ...
3
votes
0answers
96 views

When I'm on the desktop and I type anything a small window opens. What is it? [duplicate]

Possible Duplicate: What is the text box on the desktop for? When I'm on the desktop of Ubuntu, I type something and it appears in a small window in the lower right corner of the screen. ...
4
votes
2answers
105 views

How do you print/recall the definition of a function in bash

I can define and print the contents of variable called my_var like this: my_var="hello" echo $my_var but if I define: my_funct {echo "hello";} how can I recall my function's definition later on? ...
2
votes
2answers
327 views

How to bind multiple commands

We all have to use ls |more and also some other commands. So i just need info is there a way to bind multiple commands together like I want to bind ls|more together.So when i simply pass ls command ...
3
votes
2answers
151 views

Batch Starting Servers

How I can create a batch alias for bash? I need to do this: cd /somefolder bundle exec unicorn -p 3000 rackup faye.ru -s thin -E production bundle and rackup - this is 2 servers for example I ...