Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

1
vote
1answer
14 views

Bash completion for commands that start with specified letter?

Is it possible when I press Ctrl+r and after this, for example, press the letter a, then using the up and down arrow key to search only the commands in the history that start with a? Or if I type ssh ...
0
votes
1answer
17 views

get a tab out of a vector

if I have the first line of my file looking like this NAMES n1 n2 n3 betwen row1 and t1 there are two tabs but there should only be a single tab...the line is in a larger file it is ...
1
vote
1answer
22 views

Error with #!/BIN/BASH MAC [on hold]

I am trying to host a unturned server, and I watched a tutorial on youtube. So that is what I wrote in textedit for the launcher of the server (a .command) : #!/BIN/BASH ...
0
votes
1answer
13 views

Bash Script for Dump Several Processes on Android Devices

I have created three bash script for dumping several processes that runs in the Android device. The first bash script: #!/bin/bash echo "adb forward tcp:8888 tcp:8888" adb forward tcp:8888 tcp:8888 ...
0
votes
1answer
16 views

How can I create a shortcut that acts as a tally

For my work I have to do repetitive tasks with weekly deadlines. I like to know how close I am to finishing these tasks so I tend to keep a tally on a piece of paper. Unfortunately I travel a lot and ...
0
votes
2answers
23 views

Run a .sh file depending on the content of a file

I want to create a .sh file that needs to have a look into the content of a different file, in this case is the postgresql configuration file. Is there any way that I can run a command within the .sh ...
0
votes
1answer
16 views

setting up VOCE api in ubuntu

I am using ubuntu 14.04 . I recently downloaded a speech recognition and synthesis api called voce. For installation it told me to run the build.sh file. When I run this script it pops out some errors ...
-3
votes
0answers
49 views

Round numbers to remove all numbers coming up more than a single time [on hold]

Consider the following vector V of ascending numbers: 2 7 8 9 11 15 34 91 91 92 94 The problem is that some numbers may be duplicate (like 91 in this example) -- I don't want to remove the ...
5
votes
2answers
34 views

Is it possible to make sandwhich aliases?

I'm looking for a way to make the following alias work for any file name. alias dim='cd /home/jason/Documents; vim *the desired file*; cd' I'm wondering if there is a way I could change this alias ...
3
votes
3answers
97 views

apt-file regex: escaping a dot

I want to find all packages which provide a shared object containing "ssl" in the file name. The apt-file manpage says: --regexp | -x Treat pattern as a (perl) regular expression. ...
-1
votes
1answer
30 views

Use of quotes when running commands on a remote machine using ssh

I have a command that I know works correctly when I remote into a machine and run it. The command is below: grep "SearchTerm $1" file.txt | sed 's/^.*SearchTerm $1,//g' | sort | uniq -c | ...
0
votes
1answer
27 views

Using Upstart / init with PHP daemon nohup php daemon.php

Till now I had no real need to learn bash and init scripts as I need to at this point. I have created a custom Twitter app that is persistently, or constantly, connected to the API. It does tasks like ...
2
votes
2answers
120 views

To understand the behaviour of script when running over SSH

Alright, lately I have been facing an odd behavior. I have small bash script which simply takes mysql dump remotely and then store data on the server itself which later get rsynced to backup server. ...
1
vote
2answers
39 views

Bash script and escaping special characters in password

I have been reading a lot of questions already asked here, however, somehow nothing is working for me. I have a bash script where I have to send password which dump database on remote machine, so its ...
1
vote
1answer
38 views

BASH->Python (2.6) piping

I need to translate this line of Bash into Python: sample1=($(/bin/cat /proc/meminfo | egrep 'MemTotal|MemFree|Cached|SwapTotal|SwapFree|AnonPages|Dirty|Writeback|PageTables|HugePages_' | awk ' { ...
2
votes
1answer
44 views

command output based on pattern

Consider I have a command with some pattern, for example: $ grep "some string" file-[0-99] how can I write result into a file that will have its name based on the current value of a pattern, so ...
0
votes
3answers
27 views

Compress folders older than x days

In /opt/abc I have a path where a new folder gets created daily. In that folder a series of files gets created. I would like to run a script every Sunday at 02:00 and compress each folder which is ...
0
votes
1answer
31 views

how to write c program code to display directories in linux terminl [on hold]

i want a c program to get all the directories from bash terminal.also i need to color different types of files in different colors. eg:-executable files should b displayed in green color, ...
3
votes
1answer
45 views

.desktop launches app with custom icon. why not shell?

I have a .desktop file that launches an app, and it uses the .desktop icon: [Desktop Entry] Name=My Ro Type=Application Comment=Web Application Exec=/path/to/myapp -test Icon=/opt/giteye/icon.xpm ...
0
votes
1answer
19 views

MySQL Crontab Check

I have a serverpilot.io server running from digitalocean (1gb Ram), MySQL will crash once a week, the stats say the server is using ~256 mb out of 1 gb, but mysql will crash saying out of memory.... ...
2
votes
2answers
61 views

How to set JAVA_HOME for all users for “elasticsearch” program?

I'm trying to set JAVA_HOME for elasticsearch but no luck till now. I tried to set it in .bashrc, etc/environment, etc/.profile all fail. this is the command I use to run elasticsearch: sudo ...
0
votes
1answer
27 views

Bash Script to search a webpage

I've Googled my problem, and it's getting more confusing. I want to write a bash script that will search this page for a specific string and echo if it's found. For example, if I wanted to search ...
2
votes
3answers
179 views

How can I discover where apt-get has installed applications?

I have installed 2 development tools named maven and ant using this command: sudo apt-get install maven ant How can I discover what are the installation directories for these tools on my system?
0
votes
1answer
27 views

How to set a permanent environment variable?

I am not yet a Linux guy and I have some problem trying to add a new permanent environment variable. So I have to set a new environment variable named CATALINA_HOME with this value: ...
0
votes
1answer
23 views

Rotate binary files

I'm trying to solve a problem with rotating binary files. I have video files which are recorded from IP camera, and I want to delete oldest files when I have less then e.g. 10 Gb of free space. ...
1
vote
0answers
18 views

Automatically switch to Singstar Microphones when they're plugged in

I am running a media computer for my sharehouse and since singstar has been so popular I want to run Ultrastar for everyone too. The problem is that getting the microphones set up can be finicky and ...
0
votes
0answers
37 views

Script for Opening Two Terminals and Execute Three Consecutive Commands [duplicate]

I intent to open two terminals and execute three consecutive commands in bash script. Basically, the first terminal will execute first command, second terminal will execute second command, and back ...
0
votes
3answers
71 views

Use of the Rename Command

I have a two part question. I have a series of files with the names "file.pdb.#", where # is an integer. 1.) How can I script to rename all the "file.pdb.#" to "file_#.pdb", where the integer is ...
1
vote
0answers
33 views

Different results of 'ps aux | grep x' if entered manually and done via script

It was probably a bad method, but I was running ps aux | grep x | wc -l as part of the if statement in a script. When I ran this from the command line as a regular user, the result would be 1 if the ...
0
votes
0answers
27 views

Sorry, user is not allowed to execute X as root on lt

Whenever I try to run a command from the termainal as sudo, I am now getting the error: Sorry, user {user} is not allowed to execute {command} as root on lt. lt is the name of my computer. The only ...
0
votes
0answers
34 views

What is wrong with my code so far? [closed]

I'm attempting to make a DNA translation script in bash that will take an input file, iterate through the file, and convert every three characters into the proper protein code it corresponds to. Thus ...
2
votes
1answer
33 views

How can I be sure “apt-get install” successfully finished its work?

I have Ubuntu 14.04 and I intend to download Skyrim. So I put the command into the terminal sudo apt-get install playonlinux. Everything was loading fine and it seemed to be working, however before ...
0
votes
0answers
13 views

Installing YADR on Ubuntu 14.04 error - prezto: old shell detected

I have a fresh install of Ubuntu 14.04 on VirtualBox, and I am trying to install YADR (https://github.com/skwp/dotfiles), which works really well on Mac OS X. However, after I finished installing and ...
0
votes
0answers
12 views

Standard LXC Container configs for shell scripting in Ubuntu?

I would like to do computation in neutral environment. I got a tip about Linux containers here. I am not sure how this project about Linux containers is managed, like who is the central board. ...
-1
votes
0answers
30 views

Script does not run properly under cron - restart OpenVPN

I have a OpenVPN Server, that I connect via a VM (Ubuntu 14.04). In this VM I have the following script, that checks if the connection is up, and then if it's down, it restarts the openvpn service. ...
2
votes
4answers
59 views

Remove whitespace from all array elements

I have a array called arrayvar, which is being defined as arrayvar=( $(awk '/'"$vovar"'/,/}/ {gsub("'"$vovar"'"," "); gsub("}"," "); gsub("{"," ");gsub(","," ");print}' temp1 | tr -d '\n' | sed ...
11
votes
2answers
457 views

Non-sudo alternative to /usr/local/bin for common scripts

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal. For example, I make a shell script named 1, make it executable with chmod +x 1 and put ...
1
vote
1answer
58 views

Shell script to remove unity launcher(if present in Ubuntu 14.04 ) and/or the xfce panel (in the case of xubuntu)

Just want shell script to remove unity launcher(if present in Ubuntu 14.04 ) and/or the xfce panel (in the case of xubuntu). If anybody has idea about the same then please let me know. Thanks
-1
votes
0answers
12 views

I want to allot ip adress using script file [closed]

I want to allot ip adress using script file in my C Program ,i.e. by writing the ifconfig command in the bash file and calling it. Pls help how to achieve this.
0
votes
0answers
21 views

How to set environment variables for GUI program?

I am using texstudio, a latex editor, on Ubuntu 14.04. When I start it from bash $ texstudio, and click the compile button, it works fine. However, if I start it by clicking the icon in the launcher, ...
0
votes
1answer
70 views

A bash script to show logged off users [closed]

Please help me create a bash script to show logged off users. It's easy to know which users are logged into a PC, the problem is to see those who are not, I have some time looking online, without ...
1
vote
1answer
24 views

How to use shell variables after doing sudo su

I am writing a script to fix a missing 'F' letter in a mail log file. The mail log file is continuously updating. I am getting a file name, after that I am doing 'sudo su' to get superuser access. ...
0
votes
0answers
29 views

Using sed to remove all lines containing special characters , numbers, and spaces

So I'm fairly new to using shell--bash specifically--and I'm in the process of writing a script which will translate files containing DNA sequences into a more useful format. Unfortunately, many of ...
2
votes
5answers
67 views

Add particular strings to an array sed/awk/grep

I have this ciscoFlashCopyStatus OBJECT-TYPE SYNTAX INTEGER { copyOperationPending(0), copyInProgress(1), ...
1
vote
1answer
29 views

core file size with ulimit

My question is probably not related to Ubuntu in particular, but since my desktop running this OS, I came to this forum. I am trying to change the core file size using ulimit -c command as follows: ...
1
vote
1answer
30 views

Storing some strings in a array

I have this sCSISmart1 TRAP-TYPE ENTERPRISE cyclone VARIABLES {cycHostAdapterNumber, cycHostAdapterID, cycManagerID} DESCRIPTION ...
2
votes
1answer
27 views

Passing Variable into awk gsub

I have this command Here vovar=OBJECTS prvar="$(awk '/'"$vovar"'/,/}/ {gsub("$vovar"," "); gsub("}",": %s,"); gsub("{"," ");gsub(",",": %s,");print}' temp1)" Contents of temp1 ...
0
votes
0answers
16 views

How can I make the bash pager recognise the terminal window width setting?

I checked that/bin/less is the default pager inside the bash shell. Try for instance: $ man man | egrep regex It does not automatically recognize the terminal window's width setting I have set to ...
0
votes
0answers
27 views

Ubuntu 14.04 desktop goes to sleep when issued “poweroff” command while lid closed?

My ubuntu version is 14.04 LTS. I used the following command to shutdown the system after a certain process was completed (This process takes a long time to complete, so I needed a way to ...
0
votes
0answers
14 views

Getting Rid of Autojump

I just removed autojump and I still get this line whenever I access my command terminal: bash: /usr/share/autojump/autojump.sh: No such file or directory I used sudo rm -rf autojump as my primary ...