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

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

Script for Opening Two Terminals and Execute Three Consecutive Commands

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 ...
1
vote
4answers
9 views

Ubuntu 14.04: New user created from command line has missing features

I am trying to create a new user in Ubuntu 14.04 LTS from the bash command line. I use the following commands: sudo useradd -c "Samwise the Brave" sam sudo passwd sam Enter new UNIX password: ...
0
votes
2answers
14 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
17 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
10 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
30 views

What is wrong with my code so far? [on hold]

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
24 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
9 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
10 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
17 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. ...
1
vote
3answers
33 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 ...
10
votes
2answers
420 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
32 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
0
votes
0answers
9 views

I want to allot ip adress using script file [on hold]

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
17 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
57 views

A bash script to show logged off users [on hold]

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
23 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 ...
0
votes
3answers
45 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
23 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
23 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
10 views

How can I tackle a pager formatting trouble with (certain) man outputs?

I ran into something that made me suddenly 25 years younger today. (Wish this could happen more often.) That long ago it was troff that occasionally did this; now see: $ man man -> normal output to ...
0
votes
0answers
18 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
13 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 ...
0
votes
2answers
47 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 ...
4
votes
3answers
261 views

How can I pipe the output of a bash or shell command to the clip board? [duplicate]

In order to minimize mouse usage (accessibility and health reasons), how can I pipe the standard out to the OS clip board? That is, I'd like to do something like: $ drush uli | ...
0
votes
2answers
20 views

appends n-th line from the file x at the end of the file y

I have been asked to write a command that appends the n-th line (MYN) from a file (x)to another file (y). Here's what I've done so far: MYN=4 hey=$(awk 'NR==$MYN' x) echo "$hey" >> y But why ...
2
votes
2answers
115 views

How do I write a Bash script for this scenario?

I have these files in the directory home/acs. TBBN027162G_38d8-2f08-0c40 TBBN027605G_38d8-2f08-1518 TBBN027941G_38d8-2f08-0d1c TBBN027923G_38d8-2f08-35e4 I want to read TBBN027162G as service_id ...
2
votes
2answers
176 views

How to cancel next job in order after rsync

If two jobs are entered into bash command line separated by semicolon: $ job 1; job 2; How do I cancel the second one? If I press CTRL+c, the first one will be canceled and 'job 2' would start, I ...
6
votes
5answers
266 views

How do I delete everything after second occurrence of quotes using the command line?

I have this store in a variable sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00 ENTERPRISE compaq VARIABLES { scellNameDateTime, scellSWComponent, ...
0
votes
2answers
38 views

How to make a script delete a directory after checking for its existence?

How might one make a bash script which when run will check for the existence of a file/folder and if the file/folder is there remove it?
1
vote
2answers
58 views

How to change niceness of process by name

Java process is killing my computer (Intel i3, 8GB RAM). It takes over whole CPU and system starts to hang. I was trying to change niceness of java processes but i have to control it for all time and ...
1
vote
2answers
33 views

Make echo ignore spaces?

I have a file called temp1 sCellEventTrap-03-27 TRAP-TYPE -- CAC Code: 01 ENTERPRISE compaq VARIABLES { scellNameDateTime, scellSWComponent, ...
0
votes
0answers
13 views

OpenVPN --up called scrip does not work properly

I use such command to run my OpenVPN connection (part of script): gw=`netstat -rn|grep UG|awk '{print $2}'` openvpn --config ./openvpn.ovpn --up "./up $gw" >/dev/null 2>/dev/null& So I ...
3
votes
2answers
54 views

How to execute a custom script when Internet reconnects?

My Internet gets disconnected every now and then. I'd like to run a Bash script every time the Internet reconnects. The script is quite simple: #!/bin/bash mplayer /home/user/sound.mp3 It's placed ...
6
votes
1answer
83 views

How can I send commands to specific terminal windows?

I'd like to write a script for opening multiple programs (servers) simultanously in separate terminals - doesn't matter which one - and assign different commands to different terminals with commands ...
0
votes
2answers
41 views

Ubuntu can't find my bash-script at /usr/bin/

On my first Xubuntu I successfully copied my script trans.sh to /usr/bin, made executable and after that I can run it in any position of terminal, but my second Xubuntu can't find my script in ...
1
vote
0answers
19 views

Passing Strings to /bin/login

I'm in the process of creating a login wrapper for /bin/login so that when you boot Linux you get a TUI Login instead of the bland login on the tty console. This will be just a bash script for this ...
1
vote
1answer
45 views

Ubuntu shutdown script

I am using Ubuntu 14.04 and looking for updating an script to allow passwordless powering off my machine after executing set of commands. To do so, I have configured sudo shutdown now and it does the ...
0
votes
1answer
31 views

Add or remove locked Unity launcher items from terminal? [duplicate]

I've been building a very thorough script to handle the process of fresh-installing Ubuntu and setting it up just the way I like (as well as adapting it for use at where I work). It's a bash script I ...
2
votes
2answers
79 views

Does bash (or any shell, for that matter) have an 'overwrite' mode?

I'm running similar commands on (e.g.) a set of files. As an example, let's say I'm doing something like this (this isn't what I'm doing, it's just an example): > cat path/to/dir/file01.txt ...
-3
votes
2answers
26 views

get two files together [duplicate]

how could I get two files together like this file1.txt: ROW 1 3 5 654 56 5 56 65 6 54 4 3345 35 53 3 32 2 1 ROW2 6 65 456 67 687 78 89 657 435 34 534 5 435 5 2 file4.txt: ...
3
votes
4answers
216 views

Bash create custom string

how could in bash a pattern like ROW1 n1 n2 n3 n4 up to 300 be done with some command in bash or also just perl...the delimiter would need to be \t as above
1
vote
0answers
18 views

Problem running backup script at shutdown Ubuntu 14.04.2

I want to run a script at shutdown, and a far as I can tell I've followed the proper procedures. The script (close) is supposed to launch another script (gdrive) in a terminal which prompts me to sync ...
2
votes
3answers
182 views

Dealing with bash breaking commands of a certain length

Consider you want to run this command in bash: echo -n "Command of a specific length will break at the second run attempt." Here's the output for a 24x80 TTY: ubuntu@ubuntu:~$ echo -n "Command of ...
2
votes
3answers
49 views

moving the file from one folder to another folder

I have got 2 folder in the same directory ie directory exp folders name data ,log. I wold like to write the bash script so that when I click on move .sh file then content of data folder should ...
2
votes
1answer
45 views

Print characters behind the digits

function/script, that for argument in format (alphas and digits) afa5hgt3tt, errerew9ax66w, prints characters behind the digits many times as value of digit, e.g. hgthgthgthgthgttttttt ...
2
votes
1answer
39 views

Print “hello” if number of files in a directory is bigger than the number in first line of a file

Write command line that prints hello if number of files in current directory is bigger than the number specified in first line of file check. This works fine but i want a one command line. Any ...
1
vote
1answer
42 views

How to restore bash executable after accidentally delete it?

I accidentally doing something wrong, want I meant to do is: ln -svf /bin/bash /bin/sh But, I miss typing it and become: ln -svf /bin/sh /bin/bash So, bash is now a symlink that point to sh ...