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

learn more… | top users | synonyms (1)

-1
votes
1answer
25 views

Purging custom .deb package through script exits suddenly

I am a developer, who sometime works on deployment related things. I am using Jenkins to auto-deploy my application to an ubuntu 14.04 machine. My application is packaged as .deb and some supporting ...
-1
votes
0answers
22 views

What is bash or shell ? Are they interchangeable words? [duplicate]

I am a newbie to Linux environment. By searching tutorials, too many time i heard or saw a bash and some times shell. Are they the same?
2
votes
1answer
43 views

How to delete multiple lines from txt file, based on a variable in previous column?

The idea is this: I have a document with data listed in the following way (shown below), and I want to delete any line that has a value of 70 or less in the 6th (last) column. On top of that, I want ...
0
votes
2answers
53 views

Improving bash script

I need to improve this script: nmap -PN -p 9292 -sN 192.68.12.14 | grep "open" I need to check connectivity to ip 192.168.15.24 on port 9292. If the port is open, then print "port 9292 is open" ...
2
votes
2answers
32 views

how to calculate script run time [duplicate]

Consider this shell redirect: telnet towel.blinkenlights.nl >> starWarz when it ends, the session will break, detach from host or something like that. I want to know how long the connection ...
0
votes
1answer
28 views

i need to write a bash script to check a service status and restart

i need to write a bash script to check a service status. I need to look in the command output; /etc/init.d/ipsec status The line "1 tunnels up" indicates the service is up. If the line is not part ...
1
vote
2answers
211 views

Crop a string using sed

I have a command that outputs me a list with the following pattern exp_70_T8_s1 exp_71_T8_s5 exp_72_T8_s10 exp_73_T10_s1 exp_74_T10_s5 exp_75_T10_s10 ... How can I get the numbers after "_T" and ...
0
votes
0answers
25 views

Start terminal through script with command option that can later be used for more commands?

I would like to programmatically start a terminal window that runs a command or a bunch of commands (from a script). And I would like to be able to Ctrl + C the command and also keep the terminal open ...
0
votes
1answer
48 views

How far can you go with CLI? [closed]

How far can you go with CLI? What sort of tasks can I automate? I would like to create automated scripts for home use for example I open up a terminal enter webbashexecute and then 5 web pages will ...
8
votes
3answers
1k views

Bash Script to Drag and Drop a File to New Location

I'm sure I'll get my ass handed to me for this question, but I just can't seem to figure it out. I'm new to bash scripting, so go easy on me... I want to be able to drag and drop a file onto a ...
14
votes
1answer
714 views

Is there any program for fuzzy string matching, which provides a match score?

I have list of strings in file A and file B. I want to take each string in file A and find the most similar string in file B. For this, I am looking for a tool that provides fuzzy comparing. for ...
0
votes
0answers
35 views

Difficulties setting time and date

I have an ubuntu 14.04.4 server installation, where I cannot set the time. user@machine:~$ sudo date -s "2016-04-04 08:53:00" [sudo] password for user: Mo 4 Apr 08:53:00 CET 2016 user@machine:~$ ...
1
vote
0answers
16 views

How to Show History of Port State/Activity?

Let's say I have an open port on my PC like 6789. I use this port for a special purpose. But, suddenly I found the port 6789 is not listed in netstat -ntlp (port closed). How can I see the history of ...
0
votes
0answers
24 views

Export path with spaces to ~/.profile [duplicate]

So this is very, very weird. Hoping for some help. This is the path I'm trying to export in my ~/.profile: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server Here is what I ...
3
votes
1answer
71 views

How can I check why diff command failed?

I was running diff --brief -r /home/mateusz/ /media/mateusz/Database/backup_test_tmp_folder/home/mateusz/ command that completed with error code 2. According to documentation "Exit status is 0 if ...
0
votes
1answer
242 views

403 Forbidden you dont have permission

i want to install steam in my computer ubuntu 14.04 when i install steam its says that forbidden 403 how can i fix ???? HELP it says that You don't have permission to access ...
0
votes
1answer
40 views

Why doesn't System Monitor tell me which process is using the CPU?

On a Ubuntu 14.04 machine I set up recently, I noticed that sometimes the CPU consumption in System Monitor was at 30 or 40%, yet in the list of processes, only a few processes were listed as using ...
0
votes
0answers
25 views

How can I disable “Press enter for maintenance( or type Control-D to continue):” message when enter the single mode?

As title. I log into my system with single argument to kernel, everything's fine. But one day after I passwd -d root and boot again, I found the shell ask me to press the enter or ctrl-d to enter my ...
1
vote
1answer
33 views

Replace text in one file and match in second file

I have two text files, file1 and file2. In file1, I would like to start the numbering in the second column (after the space) from 0. However, this new numbering should match the numbering in file2. ...
4
votes
1answer
26 views

Why must there be a technical separation of shells into login and non-login kinds?

Shells can be login as those run by the text console and non-login as those run by Gnome Terminal. Why is this complexity needed? Why can't a login shell follow the same rules as the non-login?
0
votes
0answers
26 views

How to set environment variables with a dot(.) in ubuntu

I want to set an environment variable in bash called cloudsql.url with a value http://localhost:3306/xyz?user=username&password=password I tried with export ...
0
votes
0answers
26 views

How to run a unix script in Ubuntu14.04? [duplicate]

I am using Ubuntu14.04.2. I am new to linux and ubuntu. I am trying to install a tool (IsoDE; http://dna.engr.uconn.edu/?page_id=517) for RNASeq analyasis in my workstation. I have downloaded and ...
3
votes
2answers
46 views

Customise up and down keys to match cmd (point-in-time) functionality

How do I customise Bash so that up and down keys are the same as in cmd? E.g. $echo command1 $echo command2 $echo command3 $echo command4 In both Bash and cmd, pressing ↑, ↑, ↑, ENTER will run ...
3
votes
3answers
294 views

Bash comes to windows 10 [closed]

Today all I see on my Facebook is news of Microsoft working with Ubuntu to bring bash to windows How to download it? From Ubuntu? Windows? Nothing in Windows store. Why they keep saying Ubuntu ...
0
votes
1answer
39 views

duplicity: problem parsing WebDAV URLs in bash script

I am not a seasoned Ubuntu admin, so please bear with me if I am missing something obvious... Many WebDAV-providers supply usernames as "emailaddress@provider.tld". Although this does not seem to be ...
1
vote
1answer
24 views

Find the GIT Repository in specific directory and exec git bundle command

I am using ubuntu 12.04 TLS in which i have a git repository in a specific directory, what i am trying is to take the scheduled backup of the repository and place it in specific directory that can be ...
3
votes
1answer
35 views

How to avoid killing the wrong process in a bash script?

I'm writing a bash script that spawns a couple of child processes, and will be run by a cron job every hour. It's actually running an rsync command to a remote server, and the associated ssh ...
4
votes
3answers
196 views

Reading and writing a file: tee command

It is well known that a command like this: cat filename | some_sed_command >filename erases file filename, as the output redirection, being executed before the command, causes filename to be ...
3
votes
2answers
63 views

How can I determine if a video can be encoded successfully with HEVC (x265) encoding

I'm testing out converting some videos to HEVC encoding utilizing ffmpeg and libx265 and I've discovered that the the input width must be divisible by 8 in order to successfully re-encode. I would ...
1
vote
0answers
10 views

Start a GUI in NetworkManager if-up.d script

I was wondering if it was possible to start a graphical application from a bash script when my openvpn is up. I was trying with command like this: gksudo -u username "sh -c '(/usr/bin/firefox &) ...
0
votes
2answers
44 views

Ubuntu not finding executable in PATH

I installed node and npm from sorce and created symbolic links to my /usr/local/bin folder. npm works like, but trying to run node shows an annoying message instead of running the executable on ...
1
vote
2answers
215 views

How do I replace '<p>' with '<p>\n' and '</p>' with '\n</p>' using sed?

I have following file and I want to replace <p> with <p>\n and </p> with \n</p> using sed. My input file contains the following lines: <p>This is home.</p> ...
-4
votes
1answer
43 views

Bin directory in Linux -rwxr-xr-x 1 root root 920788 Mar 28 2013 bash [duplicate]

-rwxr-xr-x 1 root root 920788 Mar 28 2013 bash what does this line mean. I found it in the bin directory.
1
vote
1answer
45 views

How can I simulate unplugging and plugging in my usb mouse from terminal and bash script?

When I ever boot into Ubuntu my wireless usb mouse gets stuck for moments frequently and the mouse wheel is too sensitive. Only when I unplug the wireless usb and plug it back in does the mouse ...
1
vote
2answers
198 views

Get a specific word using awk

I am coding a script to check mysql databases using bash script, I would like to check if the status of a table is not 'OK', will return the table name and do some more actions: check.log table1 ...
3
votes
1answer
90 views

Simple script for monitoring wireless status

I want to create a script that monitors the status of the network (I do not know if there are any programs that already do what I want to do even better). I'm only interested in monitoring the signal ...
2
votes
1answer
57 views

Upstart Script not catching mono application's start or stop

I've used the below script both with and without expect fork. It's purpose is to start a .exe file on start-up, and if it fails, to restart it. The mono application must be started by root/sudo to ...
3
votes
2answers
675 views

Why won't this script run on startup?

This script works perfectly when I launch it manually. How can I get it to run on startup? The function of the script is to get Docky to auto relaunch in the case of a crash. I created the script ...
0
votes
1answer
58 views

Copy files from directory if the name is present in a text file

#!/bin/bash while IFS='' read -r line || [[ -n "$line" ]]; do cd /home/Sud/Minimal\ Packages/All/ if [ -d $line ] then cp $line*.rpm /home/Sud/NewFolder/rpms/ else ...
3
votes
2answers
172 views

Shell variable is not working

I'm trying to launch a program through a variable and it reads run.sh fine but it runs into issues when trying to launch the .jar file. Normal running run.sh works fine and it launches the program as ...
0
votes
1answer
62 views

My permanent alias isn't working [duplicate]

Sorry I am new to ubuntu, just installed it. The version Ubuntu 14.04.4 LTS. I finally learned how to install a program called WebStorm and trying to create an alias for it. I tried creating it ...
0
votes
1answer
26 views

Define a variable inside a function [closed]

I am wondering if it is possible to do like JavaScript, calling a variable from a function, something like: function myFunction(variable){ // do some stuff here } Then we call it like: ...
11
votes
2answers
1k views

Can anyone explain why this happens in bash?

$ sudo -iu abc ls -ltr /sites/servers/server_instance/logs/access* ls: cannot access /sites/servers/server_instance/logs/access*: No such file or directory $ sudo -iu abc ls -ltr ...
0
votes
0answers
15 views

Launch a shell script with arguments from Unity “Dash Home” menu [duplicate]

First off, I know about lenses, and am in the process of beginning to write one for this, however this is "lowest hanging fruit" for the interim. My company uses unfuddle to manage tickets (similar ...
1
vote
1answer
79 views

'source' builtin in bash not recognized in cron environment

A user crontab entry that reads: 0 */4 * * * $HOME/postscript/fprogcache-sync works fine. Wanting to add a few environment variables to the cron-job context, I then tried 0 */4 * * * source ...
1
vote
2answers
49 views

How to store file information into an array?

With this part of script I can get a necessary information about files in my directory(and subdirectories). The only information I need is the extension and the size of file. for file in `find . ...
1
vote
3answers
129 views

How to simplify the command : four same structures?

ntpdate 110.75.186.247 >> /var/log/ntpdate.log || ntpdate 110.75.186.247 >> /var/log/ntpdate.log || ntpdate 203.123.48.218 >> /var/log/ntpdate.log|| ntpdate 103.16.199.21 >> ...
0
votes
1answer
37 views

How can i get this script working?

The Script(input.sh): echo "What is your name?" if [[ $1 =~ "*" ]] then read name1 read name2 echo "Are you really "$name1 "??? or" $name2 "?" else echo "Are you really "$1 "??? or" $2 "?" fi What ...
0
votes
1answer
28 views

Bash If Statment help

I have this if statment: if $type = 1 then date +%s | md5 | base 64 | head -c $length >> $name.txt elseif $type = 2 then date +%s | shasum | base 64 | head -c $length >> ...
1
vote
4answers
91 views

In Bash, how to read a file and take each line as incremental variable?

I have a file like below: (list.txt) 127.0.0.1 us 127.0.0.2 uk 127.0.0.3 cn 127.0.0.4 fr 127.0.0.5 ru 127.0.0.6 bd 127.0.0.7 hk I wanted to make an script which will show the user as items to ...