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

learn more… | top users | synonyms (1)

2
votes
0answers
23 views

What setting controls this feature in my .dialogrc file?

I'm writing a bash script for personal use that uses dialog. My script is #!/bin/bash DIALOG=${DIALOG=dialog} $DIALOG --title "Title" ...
1
vote
1answer
24 views

How to write a bash completion to complete director names starting at ~/

Imagine I have a bash script called myscript that will only echo it's first argument, which will be a directory name. Example of usage: myscript proj1 Where proj1 is a directory for example located at ...
0
votes
2answers
47 views

How to Keep Text Consistent in A Shell Script

Good Day! I am creating a Shell Script so I can then use it to do X (Won't tell) This is my Current Script clear echo Ahmad A Kazi echo IDNO: BD_3456 echo echo Data Clear Program echo c 2015 Ahmad ...
1
vote
1answer
39 views

How can I print a variable to a file?

How can I print the contents of a variable into a text file? For example, I have the following script: #!/bin/bash #My Bash echo "saisir votre nom" read $name I would like to print the contents of ...
2
votes
1answer
114 views

bash: /home/…/program: cannot execute binary file

I've got a problem with simple program. When I try to run it double clicking it. Also when I try to run it by writing its path in the termilal and it says bash: ...
1
vote
1answer
32 views

How to move all subdirectories to current directory?

I'm new to shell script programming. Suppose we have a file hierarchy like this: /A/B/C/D /A/B/E/F/G /A/H/I /A/H/J/K Note that here we not only have /A/B/.., but also /A/H/.... All letters are ...
1
vote
4answers
47 views

Bash - IF and && syntax?

I could use a little help with my IF and && statement. It's not working and nothing I'm trying is working either. Maybe someone can see the issue: if [[ $thisvariable="yes" && grep ...
3
votes
2answers
306 views

copy to clipboard current path from console with no mouse [duplicate]

I'm wondering if it possible to copy to clipboard output of pwd command. I often need to copy some path and I have to select it with mouse, do several clicks and that is annoying for me. What I want ...
0
votes
1answer
49 views

What does “.bashrc or prepend the Anaconda install location” mean?

I installed Anaconda from root, after completion of installation this message was displayed on terminal screen: Python 2.7.8 :: Continuum Analytics, Inc. creating default environment... installation ...
5
votes
1answer
119 views

Shell scripting bash: How to detect Alt+N keystroke?

I want to write a script that always listens in the background and execute a particular command when the user hits a specific key combination such as Alt + N. How this can be done?
0
votes
1answer
19 views

Website Files Permissions

I am trying to set all folders and subfolders (directories) to 755 and all files that are contained by folders and subfolders to 644. I don't know how can I do this from 1-2 commands. Is this even ...
1
vote
1answer
17 views

Diffrence among environment/profile/bash files

I know the difference among ~/.bash, ~/.profile vs. /etc/profile. I know (please correct me if I am wrong) configuration in ~/.bash is applicable for a specific user and terminal only.Configuration in ...
1
vote
1answer
24 views

How to install novo-builder?

Recently,I want make a Ubuntu live CD. However I don't know how to install novo-builder. The document is Install_Novo_Builder.bash. How to install novo-builder by .bash?
4
votes
0answers
48 views

How to detect keystrokes?

I have a script running always at the background. Inside that script I have to write the codes to detect keystrokes, and once a particular keystroke is detected, the rest of the script must be ...
0
votes
0answers
21 views

Update dynamic IP and fail2ban

i have a script running via cron to allow ssh only through some known IP's. Since my Home-IP is dynamically associated i use this script running every 15min: #!/bin/bash ...
0
votes
1answer
23 views

need help installing AptUrl or changing the enviromental variable

I understand how to get the file to install, I have to type out "sudo apt-get install apturl" and it should open the package for installation. I type out the command and I got this "mspyellow@BJ:~$ ...
0
votes
1answer
42 views

Problem in unmounting a disk image with a script… but not manually!

It is my first experience in writing shell scripts and something curious is happening. I'm working on an embedded system and I wanted my script test5.sh placed in the /root folder of the guest system ...
0
votes
4answers
272 views

bash script which checks input to see if it is “y”, “n” or other - not working

I have written this bash script which is meant to check your input to see if it is y, n or something else (this will be part of a larger project): #!/bin/bash echo "Have you updated the PATH ...
1
vote
0answers
37 views

Showing progress in whiptail while using sshpass and SCP

I'm writing a bash script that automates the building, copying and running of a golang app to a remote server. I'm using whiptail to let the user pick some options, enter in some details (e.g. SSH ...
0
votes
1answer
41 views

Executable won't execute

I hope that my post is acceptable although I am actually running lubuntu, not ubuntu. I am trying to create an executable file but I am having difficulties. I created a script with a text editor and ...
0
votes
1answer
41 views

for loop over character array gives unexpected “(”

I am a bloody beginner in bash scripting and I am sorry if the following is very simple. The error I get is: 4: Syntax error: "(" unexpected I am basically trying to run the following in bash on a ...
0
votes
2answers
39 views

Traverse file system and move files

I need to write a script that will go into a list of directories and then move files of cretin file types into a other directory. With the code bellow I am able to iterate over all the folders in a ...
0
votes
1answer
56 views

How can I detect when the boot sequence is complete on headless system

I have a CONF file in /etc/init to configure and start software on my headless machine. When a monitor is attached for development and testing I see that my software starts near the end of the boot ...
0
votes
1answer
37 views

What's the shell session?

What's the shell session ? job seems like a process, is it? Can one shell prompt can manage multple shell sessions ?
0
votes
0answers
68 views

Permanently adding folder to PYTHONPATH [closed]

Before I'll ask my question, just to let you know, that I did some HW for this topic but still have some issues that I don't actually understand. Unfortunately I can't list all those links here ...
8
votes
2answers
434 views

Case sensitivity in shell scripting

Consider this Bash script: #!/bin/bash echo Enter any character read char case $char in [a-z]) echo Lower case letter ;; [A-Z]) echo Upper case letter ;; [0-9]) ...
1
vote
0answers
30 views

How to get bluetooth serial port tx/rx buffers status?

The problem comes from that I have to send data via bluetooth serial port from a tiny robot to my laptop at baudrate 115200, robot sends 32-bytes packet every 10ms (100 times per second). Transmission ...
1
vote
1answer
127 views

Copying contents of subdirectories in their parent directories

I have a list of jpeg files in a directory like this (below is just a sample, like the structure is the same but this there are many fo0# sub-folders, not only fo01 and fo02, where each of these ...
0
votes
2answers
55 views

What is the best practice of customizing the Bash prompt (aka the PS1 environment variable)?

I am trying to add Git branch name to my Bash prompt by changing the PS1 variable like this: PS1=`echo "$PS1" | sed 's/\\\\\$ $/\$(__git_ps1)\\\\\$ /'` And if I understand correctly, it is not ...
1
vote
1answer
41 views

How to use packages.ubuntu.com like apt-file search for different releases?

I'd like to use the power of http://packages.ubuntu.com/ from the command line in a similar way apt-file search -i works to find the packages providing a file containing a specific pattern. I cannot ...
1
vote
1answer
74 views

root shell bash commands not working

I attempted to change my sudo password(I removed myself from sudoers list by mistake). I tried following. In recovery mode, I dropped down to root shell. It is still asking root password. Ctrl D ...
1
vote
1answer
31 views

using watch run 2 commands

I have to do watch two commands in the same terminal windows. I mean something like watch du -h filename.txt && df -h But its showing only one output. So what I am thinking is may be its ...
0
votes
2answers
38 views

replace string in a file with another where both are saved in variables

I want to replace a string found in a file with another string, but both have a special character (in this example it is a . char) e.g 1.0 and 2.0 so this the is command currently used: sed -i ...
-1
votes
0answers
14 views

VPN Connection help meeee fast

im stuck, i just installed ubuntu 14.04lts, i have a dial up Internet, i used my isp's guide for Ubuntu but im stuck, help me fast, asking this question from mobile phone im using this guide ...
1
vote
3answers
44 views

How to cat in for loop

I have 500 folders containing many *_1.fastq.gz and *_2.fastq.gz files per folder. I want to: cat *_1.fastq.gz > Combined *_1.fastq.gz & cat *_2.fastq.gz > Combined_2.fastq.gz per ...
1
vote
1answer
38 views

How to execute a number of lines using xargs

I have a large sql dump that has 1 insert statement per line. I want to be able to pipe this to xargs so that I can slow down the writes. Basically I want to execute a number of lines, sleep, then ...
3
votes
1answer
137 views

Use a list of words to grep in an other list

I've got a list with 250 lines in it. I have to run all of them through a web server to get a list of output. This list, however returns many more lines, than I'm interested in. Say, my list.txt is: ...
0
votes
1answer
54 views

Making a Bash script to set desktop wallpaper as animated gif — what do these errors mean?

I was following this tutorial to see if I could make my desktop wallpaper in Ubuntu into an animated gif. In the tutorial, I copy and pasted a script that would supposedly allow me to do this. ...
0
votes
1answer
40 views

Echo command does not show text in terminal [closed]

this is what i wrote in myscript file #! /usr/bin/env bash echo "Hello world" then i added myscript path to PATH variable and ran it as a command. the command apparently run without error but ...
3
votes
5answers
305 views

Extract part of a line upto a particular string

Let us assume I have a file with lines like: /java/jdkxx/jvm_jdk/bin/opt /java/jre/jre_jvm/bin/opt /foo/bar/bin/other/stuff/here Is there a way I can extract part of the lines upto bin. I mean, ...
2
votes
1answer
193 views

Is there a way to fill an image with its background color to square size?

Let me describe my problem: I have a site where I post sponsors company logos. Once I'm sent the logo (or I've googled) they are usually in rectangle size - width and height are not equal. On my ...
1
vote
1answer
37 views

How to configure desktop appearence from the terminal?

I'm creating a small script to setup the installation with my preferences and I'd like to know how can I change desktop appearance settings from the terminal. Things like: Set the default app to ...
1
vote
0answers
22 views

Disappearing files in the cat command

I am handling a rather large dataset. I have 238 files, for whcih I would like to import their content into excel. In order to do so, I am creating a combined txt file using cat *.pdb > ...
4
votes
2answers
94 views

Print a group of lines if they contain specific strings

I have a file (file 1) that looks like that: >C 0 0 4231aa, >A6_03412... at 1:4226:1:4240/95.44% 1 4240aa, >A5_01600... * >C 1 0 4159aa, >FG1_03697... * >C 2 0 3942aa, ...
3
votes
0answers
27 views

Is there a way of telling apt to run when it can - when the previous instance has finished? [duplicate]

I am quite absent minded, and I forget everything I want to install - especially after a restart Is there a way that I can set another command to run (in a separate terminal, of course) when the ...
0
votes
0answers
12 views

Sorting out consecutive duplicates from bash history [duplicate]

When I press the up arrow in my terminal I want to get to the last command that is different to the previous command. a b b b If that is my command history, then I want the following ...
2
votes
4answers
246 views

Repeat each line in a text n times

I have a file that looks like this 888 924 873 1374 ..... The dots indicate that I have many more string, around 3000. I want repeat each string n time, to have something like this; 888 888 888 ...
0
votes
1answer
20 views

using cut in a loop script

I am using bash on my macbook pro. I have a list of files in a directory that I'd like to use the cut command on. When I use this command: cut -d " " -f 6- 2.ostat > 2.ostat1 it works nicely - a ...
0
votes
0answers
23 views

Shell Script whenever i am SSH it will change my terminal title bar according to that SSH ip

I'm not much expert in shell scripts. I want a shell script, that, whenever I am inside an SSH session, will change my terminal title bar according to the server IP address.
3
votes
2answers
51 views

Rename all file extension in directory

I am new to scripting, and I have a directory with all files named num.pdb.ostat. I would like to rename all num.ostat (that is deleting the .pdb in all). For a single file this works: mv 2.pdb.ostat ...