Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more… | top users | synonyms

1
vote
0answers
6 views

Runnine `exec` with a Bash built-in/reserved word

I defined a shell function (let's call it clock), which I want to use as a wrapper to another command, similar to the time function, e.g. clock ls -R. My shell function performs some tasks and then ...
0
votes
3answers
24 views

Create a new Mac Terminal command to copy folder

How can I create a new terminal command that copies a folder (this will always be the same folder) and it's contents to either the current directory (if no path is supplied) or to the path supplied. ...
0
votes
0answers
21 views

Command to see my current ip if proxy is applied only for a certain website

It might not be a relevent question here on so, but I tried on http://networkengineering.stackexchange.com and there are less users + they redirected me here. So, I am not a networking guy and I have ...
2
votes
2answers
16 views

GNU sort cyrillic lines ignoring the case

I have got a file in UTF-8 with lines of latin or cyrillic letters. I'm trying to sort it, ignoring the case. I have tried LC_ALL="ru" sort --ignore-case in.txt but still got cyrillic lines in ...
1
vote
2answers
19 views

Should I ignore .bash_rc, .bash_profile etc if I'm using Zsh?

Zsh configs go into the ~/.zshrc file. That’s where I’ve been putting my aliases, etc… But I want to know if I should be ignoring .bash_profile and those other files, and putting everything into the ...
2
votes
0answers
36 views

Mounting a directory from the host in boot2docker for Windows

I'm running docker 1.6 and boot2docker on a Windows 8.1 box. When I use the Boot2Docker Start shortcut, it takes me to a cygwin bash prompt where I can run docker commands natively. I'm having ...
0
votes
0answers
10 views

LXC: Automating running an application inside a container

I'm working on a project that automatically compiles, executes and tests the output of submitted programs in C, C++, Java and Python. Obviously this needs to happen inside some sort of secured ...
0
votes
1answer
10 views

Website updating from git (over ssh)

I have a script that I run over SSH, which updates my website from a Git repo. cd website-git git checkout master git pull # Update protected directory rsync -v -a --delete --exclude=db ...
0
votes
0answers
19 views

Why does sudo -n on Mac OS X always return 0?

It looks like sudo -n on Mac OS X (10.10.3) always returns 0 as a return code. So something like this will always show 0, regardless of whether the user has authenticated with his password first: ...
4
votes
3answers
197 views

How to redirect output of a command to a file when the command will prompt user inputs?

I have a command which will prompt user for some inputs and then output the result to the terminal. I typed the command like below to redirect the output to a file: $the_command > abc.txt But it ...
2
votes
1answer
116 views

How to make a bash script that names files with today's date

I'm trying to make a script to back up my we servers, but I have very limited knowledge with bash scripting. I want the script to name the backup file ht-"today's date". How would I go about doing ...
1
vote
1answer
19 views

Run a function from bashrc, but modify exported variable

I am trying to run a function from my bashrc that refreshes every minute and externalizes a variable. It looks like this: export CFN = '' _some_fn { export CFN = 'test' sleep 60 _some_fn ...
0
votes
2answers
33 views

How to echo string of another string shell variable

We would like to echo the value of a shell variable which has another variable string in its variable name. eg: we want the following output var1=1 var2=2 We tried several various forms similar to ...
1
vote
2answers
50 views

How to recursivly delete all JPG files, but keep the ones containing “sample”

How can I find and delete all the .jpg files in a directory tree with the exception of the ones containing "sample" in their filename? For example : a.zip -> keep it b.jpg ...
1
vote
2answers
29 views

What is the difference between the processes listed by `ps` and `ps -A`?

What is the difference between the processes listed by ps and ps -A ?
1
vote
1answer
17 views

Can't find the good Cygwin shell executable

I am working on Windows 7 and I need Cygwin for my project. I am trying to launch the Cygwin terminal from a Java programm and then write command lines but my problem is that I can't find the right ...
0
votes
0answers
16 views

Why the process of sleep command is always in sleep status?

Why the process of sleep command is always in sleep status ? Sleep status means waiting for I/O right ?
1
vote
2answers
31 views

SSH-AGENT could not open connection

I try to link my SSH key with SSH Agent. I'm on Windows 7 Pro, and I'm using Git Bash console. I've this folder structure: C:\Users\MyName.ssh\id_rsa Where I've put my SSH key files as follow: ...
1
vote
1answer
23 views

How to serach for a line which contains specific string in Bash?

I've got a file which contains some amount of lines, I want to look for a specific string, and if the file contains it, then I want to print a different line from the same file. for example, let's ...
11
votes
4answers
1k views

Who deals with the star * in echo *

Who deals (interprets) the * in echo * Does the echo see the star or the shell take care about it and return a list of filename .. What about cp temp temp*
0
votes
0answers
10 views

Creating a Package installer that will run an already made package installer

I am new to creating package installers. I am looking to create a package installer that First Runs an already created .pkg file (printer Drivers) then runs a post bash script that configures the ...
0
votes
1answer
33 views

Rsync delete only remove older source files

Ok, I could probably spend a lot of time writing a complex set of bash scripts that would accomplish this, but I'm hoping this functionality already exists somewhere. I have a device in my car which ...
0
votes
0answers
17 views

after I changeed root default shell ,what is the password? [closed]

At first my linux root didnot have password default shell is sh. I installed bash and change root default shell from sh to bash. when I log in it request me enter passwd. what is the passwd?
0
votes
0answers
31 views

How to encrypt data in bitbucket without losing git diff tools?

Based on this question:encrypt files before sending them to cloud. considering openssl: For example when using openssl we can write the files fooenc.sh: #!/bin/sh openssl enc -bf -nopad -pass ...
0
votes
4answers
27 views

What issue exists when multiple lines of 'date' are used in bash?

I'm currently reading through a book on bash programming, Pro Bash Programming. At one chapter (Chapter 4) they ask what problem the following script has. I myself have no clue after reading through. ...
2
votes
1answer
22 views

Bash completion: global expansion by presing tab

In my desktop computer with opensuse 13.1 I can press tab in something like ls *.dat[TAB] and I get the autocompletion or with [TAB TAB] a list of possible matches. However, in my laptop with ...
1
vote
2answers
17 views

How to add the filepath to a specified line of a file using bash script?

I have the following bash code: echo "Enter an input path" read -e input_path OLDTEXT="\put(0,0){\includegraphics{/" NEWTEXT="\put(0,0){\includegraphics{$input_path/" find . ...
0
votes
1answer
29 views

How to select files with spaces in their name in a terminal?

When using gnome-terminal which is the default on Linux Mint, I can select files using a double click. For example: user@hostname $> ls 1.file.name 2-file-name 3 file name with spaces This ...
1
vote
1answer
18 views

Bash completion for cd alias

I'm using the following function to list the directory contents after changing the current working directory: function c() { cd $@; ls; } How can i enable bash directory name completion for the ...
0
votes
1answer
33 views

Older History of commands linux

I want to check history of commands on my linux server that dates 1month and 4 days old, but the history is showing up to 1 month only (I was late checking it earlier). I know the ' History ' command ...
3
votes
2answers
58 views

Parse file from certain line onwards in bash on Linux

I have a CSV file containing the following registers: Name,Phone,Country John,N/A,USA Max,N/A,USA Name,Color,Size John,Blue,M Max,Red,S How can I read only the registers from Name,Color,Size and ...
2
votes
1answer
15 views

How to substitute all occurrences after a certain number with sed in OS X

I am trying to modify a bad .csv file, where the last 'column' is broken into a different number of columns due to extra , characters. I want to use sed to keep the first 4 commas, and replace the ...
2
votes
3answers
77 views

What is a backslash colon doing in this chown command?

What is the \: doing in the command below? sudo chown nobody\: folder/ Is it some kind of mistake?
0
votes
1answer
23 views

CPU Load + Frequency per core in linux terminal?

I am doing scientific computing and I need to keep an eye on the cpu frequency and load of each core (there are 2 cores, on Ubuntu 14.04 w/ Gnome3). I can see the frequency with this bash script: ...
1
vote
0answers
20 views

Send keystrokes to two windows at once

What I want to do: Be able to enter keystrokes while one program is in focus, but also send the same keystrokes to a second program on the other screen. What I have tried: xvkbd - I've tried ...
-2
votes
0answers
23 views

run multiple commands from a file after logging into putty from a bat filee [duplicate]

I have written a bat file in which I have the following: putty.exe -t -load "ABC" -l username -pw password -m "C:\Users\pathasai\Desktop\abc.txt" In my abc.txt I have written some commands which I ...
0
votes
4answers
55 views

While loop Bash script that outputs how many users use a certain shell

So I am stuck on trying to create a bash script while loop function that takes the input from /etc/passwd and outputs how many of users use bash, nolongin, csh, and ksh. I believe I am supposed to ...
0
votes
1answer
24 views

Cronjob: Iterate through files

I want to iterate through a list of bash scripts with a cron-job. I.e. every two hours I want to start another bash script. My idea was to set a new environment variable, each time the cronjob script ...
0
votes
1answer
18 views

How can echo the previous command I ran to a file?

I tried running echo '$(!!:p)' > /tmp/tmptxt.txt, however I just get $(!!:p). The previous command may have unescaped characters so I i need to escape it.
1
vote
1answer
24 views

Clear console buffer in ConEmu with Cygwin

I've recently switched from using iterm in OSX to using Cygwin in ConEmu on Windows. One thing I'm really missing is the ability to completely clear the terminal buffer at any time using Alt+k. I've ...
0
votes
3answers
26 views

Parameter substitution in sh -c

I have a large number of log files, the idea is to group them by date/month and then pack into archives. Here's my script: find /c/this/path/ -type f -name "$file_pattern" | xargs -I fn basename fn ...
-1
votes
1answer
45 views

Bash script to store words from file in different variable [closed]

I have a need to store words form file in different variable. Like I have a file test.txt containing below content: uname : null empty amarjeet sharma ver : null 1.2 empty 1.3 1.4 txn : null 123 ...
1
vote
1answer
82 views

Execute script on login Fedora 21

I'm trying to launch a script located in my home directory when I login on Fedora 21. I have tried to make this desktop file in /usr/share/autostart [Desktop Entry] Type=Application Name=Wallpapers ...
1
vote
1answer
22 views

Why is bash adding spaces and stretching out filenames in Arch Linux?

My Arch Linux laptop is creating some strange output when using bash. It puts spaces between characters and stretches out files names. I’ve tried to remove/reinstall bash-completion but nothing ...
7
votes
1answer
603 views

What is a safe ping frequency without it being considered a DDoS attack?

I am trying to chart the uptime of a server by regularly pinging it and Google and then comparing the ping times. I want to keep doing this over a period of—let’s say—a week. I am sending a set of 5 ...
1
vote
2answers
19 views

How to make sed print to the end of line from socat

I have a server which sends data in a UDP Broadcast on port 10552. The data is 7 numbers separated by commas as so. 5.351204,0.001968,-0.000473,-0.999222,0.000451,0.001455,1.084310 I fetch this ...
0
votes
0answers
23 views

etherwake fails to run when ran by cron

I have a cron job to check if a client is connected to my VPN and then wake up some other computers on my network using etherwake. I have the script running every minute and it is actually running ...
2
votes
0answers
16 views

Can one start shell from save file dialog

Using ubuntu. If one tries to print to a file, the save dialog opens. Is there a way one can execute the shell (or terminal) from the save file dialog file name entry box?
1
vote
1answer
37 views

Is there a way to run a specific script with every “halt” and “reboot” command on Linux?

I need to find a way to somehow intercept the halt and reboot commands and execute different actions via shell script before the actual halt and reboot commands are executed. Is that possible without ...
2
votes
1answer
34 views

No available formula for “pdfunite” in Homebrew?

I am on Mac OS X 10.10 (Yosemite) and I am new to Bash. I am trying to install pdfunite. I installed Homebrew and ran the following command: brew install pdfunite And I received Error: No ...