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

learn more… | top users | synonyms (1)

0
votes
0answers
18 views

awk add certain colum if two columns are similar

First at all I apologize, but I am a newbie in scripting, and I try to learn something. I have a file which looks like this: 1 A 84.54 47355 1281 1 A 80.16 47355 761 1 A 81.63 ...
0
votes
1answer
14 views

keep track of multiple terminals from shell script

I am writing a quick start shell script to automatically set up my development environment for a current project. However, none of the commands in the shell script can be executed after my server ...
-2
votes
1answer
23 views

Bash regular expression

I need to write a regular expression in bash to find the words with 5 characters where the last character is 'c' and the words contain a '.' (dot). And also to write a unix command to get a list of ...
0
votes
0answers
21 views

Start bash script from another script

I have two scripts /etc/init.d/script_1 and /opt/script_2. I need to call script_2 from script_1. In script_1 i write: /opt/script_2 And it works. But there is small option with script_2 - it must ...
0
votes
1answer
26 views

Bash Script for Running Command in Root in ADB Shell

I am trying to dump the partitions of Android devices with netcat. I have created 3 bash scripts for supporting the process. I have trouble on the second which to dumpt the specific partition ...
0
votes
1answer
33 views

read file names from files for command line

I want to run a program requiring comma-separated arrays of files as follows: program -input1 A.txt,B.txt,C.txt -input2 D.txt,E.txt,F.txt -out out.txt My bash attempt: I'm running command from a ...
0
votes
0answers
14 views

Blueman terminal commands

I'm having trouble with blueman conflicting with my wifi drivers and want to create a bash script that turns blueman off, restarts network-manager and then turns blueman on. The problem I'm running ...
1
vote
2answers
24 views

Copying exact amount of files via scp

I'm copying pictures form my iphone via scp, where filenames looks like this IMG_3134.JPG. And let's say I'd like to copy files from IMG_3094.JPG to IMG_3134.JPG. Using special characters like * or ? ...
1
vote
1answer
30 views

bash alias with parameters [duplicate]

I would like to swap from csh to bash, then I have to set the .bashrc with the commands I use. Translating alias with parameters seems to be not easier as I believed. csh: alias gr 'xmgrace -legend ...
0
votes
1answer
21 views

exit shell script when a process check is failed

i need to exit from shell script when TESTEXCHANGE process is not running on a host.How can i handle this: I have a script processcheck which checks if the process is running. I call that to the ...
0
votes
1answer
26 views

List all commands that Alt-F2 offers

I'd like to obtain a list of all commands that can be run via Alt-F2. So for shell commands this would be: compgen -c I need something similar, but only for graphical commands. So e.g. rhythmbox ...
1
vote
3answers
66 views

How can I get rid off fork bomb?

I tried the fork bomb code : :(){:|:&};: and closed the PuTTy. Now it is not accepting the new connections(Denial of Service attack). How can I recover from that ?
2
votes
0answers
25 views

Execute prelogin scripts for SSH

I would like to know how I can execute a local server script, for instance send a mail using mailx, when a ssh session is opened, pre-login stage. When a ssh connection comes into the server, I ...
1
vote
3answers
210 views

Shell script If syntax error

if ($(ipcs|grep test|wc -l)=630); then echo "Shared Memory check passed" fi I get below error: ./Test1: line 25: 636=630: command not found
1
vote
0answers
14 views

incrontab IN_CREATE event fires four times

I was looking into incrontab and tried it out as follows: /tmp/incron.sh : echo "$1 Content: `cat /tmp/test/a`" >> /tmp/incron.log incrontab -l: /tmp/test/a IN_CLOSE_WRITE /tmp/incron.sh ...
2
votes
0answers
15 views

Print the last error message from stderr?

I have a script which deploys a web service, and I found this little helper to exitWithMessageOnError. exitWithMessageOnError () { if [ ! $? -eq 0 ]; then echo "An error has occurred during ...
0
votes
1answer
18 views

Configure date to UTC format

There are a few answers to this that help with the gnome taskbar date-time display, and one answer that gives me exactly what I want, namely, date +%Y-%m-%dT%T which I've incorporated into .bashrc ...
3
votes
2answers
72 views

Where are file properties stored on the actual file system?

I am creating a program that takes a hexdump of a file, so that I can then transmit that somewhere, and have the file reconstructed, however the hexdump is only of the file contents, I also need to ...
2
votes
2answers
69 views

How to paste the text selected from gui mode after switching into cli mode?

I have set up ubuntu-14.10 to boot up in text mode (cli) and I start gui with the command sudo service lightdm start then toggle between gui and cli mode with Alt+ctrl+F1 (to get into cli) and Alt Gr ...
0
votes
1answer
20 views

Added wrong path to $PATH variable but can't find old varaible to delete it

I'm trying to install virtualenv and virtualenvwrapper to set up and IDE for Python, following a tutorial for this on Ubuntu I accidentally entered the wrong path to the virtualenvwrapper. When I try ...
0
votes
0answers
31 views

ElementaryOS Freya Installing RVM and ruby problems [closed]

Hi i have problem installing RVM and Ruby itself with ElementaryOS freya. I have installed RVM but when i try to install ruby running. rvm install 2.2 i get this. Searching for binary rubies, this ...
0
votes
3answers
94 views

Problem with “while read” and paste

I have 69 files called *.sites.pi. For instance, OC9.sites.pi, cu27.sites.pi, etc. The prefix of each file (that is before the .sites.pi) is in a file called ind_list. $ cat ind_list OC9 Ocu27 ... ...
1
vote
1answer
43 views

How do I run this script with sudo from the command-line? [duplicate]

I have the following script in my user's bin directory; let's pretend the filename is 'myScript': #!/bin/bash python3 /myPath/myProgram.py "$@" From the commandline, if I type myScript, it ...
0
votes
0answers
22 views

rc.local commands execution

The general idea is: I have developed a script.sh (in java) that take a value from a .txt where a python code is saving data from a sensor, (with a specific range of time). This value is up to the ...
1
vote
2answers
35 views

Cronjob bashscript help

I've looked through a bunch of cronjob troubleshooting guides, but I can't seem to find what I'm doing wrong. This script runs just fine if I run it manually. Running it from crontab just isn't ...
4
votes
1answer
231 views

Shut down list of servers given in a file

I have a list of 17 servers in this format 172.16.1.4 #servername-A 172.16.2.75 #servername-B 172.16.5.53 #servername-C 172.16.5.61 #servername-D i'd like a script that can ...
0
votes
0answers
25 views

setuid bit doesn't work

I do understand consept of SetUID and its meaning. When it comes to SeuUID,people say about /usr/bin/passwd and /etc/passwd. But, Isn't there any real example for that? Anyway, here's my experiment. ...
0
votes
1answer
34 views

How to write a shell script to start gedit and not showing the terminal window? [closed]

How to write a shell script to start gedit and not showing the terminal window? That means: when I click the file runme.sh, only gedit window shows, no terminal window shows. Just like I click the ...
1
vote
2answers
73 views

The foreground color changes after `ls` command

I change shell's foreground color with echo -ne '\e[1;31m' command but when I execute ls command the foreground color reverts back to the original previous color. This weird behavior doesn't occur ...
1
vote
0answers
43 views

Why is my shell slow after a while when I use git aware prompt and run git commands?

I am using git-aware-prompt in my .bash_profile on Ubuntu 15.4 like this: export GITAWAREPROMPT=~/.bash/git-aware-prompt source $GITAWAREPROMPT/main.sh When I am in one of my main repository ...
0
votes
0answers
26 views

Autostart shell scripts; they work from command line but not on startup (log in). Why? [duplicate]

Every time when I start my system I have to manually start some bash scripts. A script for accelerating the key rate or for swapping the ESC key with the Caps-lock key. I want my system to load these ...
1
vote
1answer
41 views

Schedule shell script to display output in terminal

I have added a shell backup script to crontab, and it seems to run every night, but I currently need to check the target to see that it's worked. What would be much more helpful would be for the task ...
1
vote
0answers
18 views

Testing post-install scripts

I love to experiment with my Ubuntu GNOME 14.04, so there are many mistakes to be made and things to learn. Often I want a clean install, so I made post-install script. Question is: what is the best ...
0
votes
0answers
18 views

Script to Cycle Through WiFi Connections

I would like to create a command line script to cycle through available WiFi connections. How would I go about accomplishing this?
2
votes
1answer
39 views

Automatic Account lock/logoff script

I have 2 scripts created. The first one called "lock_logoff" and it does just that. It locks the account in the script and then logs them off. The second script unlocks the account. I got tire of ...
0
votes
0answers
38 views

How to add samtools in the PATH permanently [duplicate]

I installed samtools executables within my bin directory under home directory. Installation works perfectly well. I am using Ubuntu 14.04 version and it has .profile and .bashrc in my home directory ...
0
votes
1answer
26 views

Replace text in file with variable using sed [duplicate]

I need to replace a string in a file by another string which is stored in a variable. Now I know that sed -i 's|sourceString|destinationString|g' myTextFile.txt replaces a string but what if ...
-1
votes
0answers
39 views

Analyse log file to display most visited websites [closed]

I have a web server log file to process and I'm required to write a shell script that analyses the log file to display the top 10 most visited websites in it. I'm extremely new to ubuntu server and ...
0
votes
2answers
39 views

Extract numbers with awk

a part of a script in awk looks like this sub(/^Mutation: {"seq-pos":/,"") && sub(/, "time":/," ") && sub(/}$/,"") { print >"fifth_"FILENAME} The aim is that given this ...
0
votes
1answer
77 views

bin/bash: ruby command not found. Ruby not in sudo path

I can't seem to run any code on ruby with any text editor. This error is returned when code is run /bin/bash: ruby: command not found [Finished in 0.0s with exit code 127] [shell_cmd: ruby ...
0
votes
1answer
11 views

Process pasued but connection not terminated to files in locasystem

I am not sure whether this is the right place or not but as this is a question which needed a solution I am posting here. I have used kill -SIGSTOP 1234 command to pasue a process named as 1234 and ...
0
votes
0answers
22 views

Why bracketed paste mode is enabled sporadically in my terminal screen?

I use Ubuntu 14.04 and I have a weird issue with my terminal screen which is bugging me a lot. Could someone help me with it or explain me if I'm doing something wrong or non linux-way? I have some ...
3
votes
3answers
123 views

Write the output of multiple sequential commands to a text file

I try to Check the latest Firefox and want to get all hashes in one TXT file. What I try to do is: sha1sum firefox.tar.gz > sha.txt and I try also: md5sum firefox.tar.gz > sha.txt | sha1sum ...
2
votes
2answers
190 views

Is typescript for `script` command the same as TypeScript maintained by Microsoft? How to print using `ldr`?

Is typescript for script command the same as TypeScript maintained by Microsoft? How to print using ldr ? What exactly is typescript in relation to Linux/Ubuntu ? Searching Google, I find that ...
3
votes
1answer
84 views

Bash script doesn't run from nautilus, but does run from terminal

Before I add more detail to my question, I have to say something very important: Yes my script has "Allow executing file as program" turned on The question itself: For programming reasons (shared ...
3
votes
1answer
30 views

Nautilus-Open-Terminal tries to open ZSH instead of bash

I recently tried zsh as a shell but didn't like it much. Then removed it and I still continue to use bash. When I was using bash, I had this cool script 'nautilus-open-terminal' which lets you open a ...
0
votes
1answer
35 views

How to open a “.sb” file?

I downloaded a game in .sb format that is partition is Ubuntu but even with the terminal I can not seem to open it. Here's what it said: fruity@xXxFruityxXx:~/Downloads$ ...
1
vote
1answer
25 views

/usr/bin/svnadd legit or malicious?

I installed OSSEC, and the following file failed a rootkit check. I'm not sure if it's malicious or what it's doing. Any help would be greatly appreciated! The file is a bash file: /usr/bin/svnadd ...
3
votes
2answers
78 views

Difference between “./” and “. ” for running a script/application? [duplicate]

I always ran scripts using ./ For example ./script.sh I recently learned that you can also type . script.sh Is there any difference? The second is much easier for me since my keyboard ...
-2
votes
2answers
63 views

Terminal command cd (change directory) directly

The directory Pictures is located at /home/mj/Pictures/ The Terminal window displays (meaning /home/mj/): ~$ In the "Ubuntu Documentation: Using The Terminal" it says: … use, "cd /var/www" to ...