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

learn more… | top users | synonyms (1)

2
votes
2answers
44 views

What are '.save' files

I have been writing several bash scripts, and I have found that while writing them that extra copies of the files have been created which seem to be identical in contents to the normal files, except ...
0
votes
2answers
18 views

Bash “move files” error message

I am trying to move some files based on a search pattern using bash but I get an error message. Here is the borrowed script format I used and the error message. Thanks! #!/bin/bash firstdir=dir1 ...
-1
votes
0answers
24 views

Can notes from Google Keep on an Android device be sorted using the command line? [on hold]

I have been trying to figure out if it is possible to sort Google Keep notes from a terminal, but I am not that good with Android. Does anyone know if Keep notes on a connected Android device can be ...
0
votes
1answer
11 views

Error when adding torrents to deluge with python: User does not exists

I am trying to write a python script to download my tv shows automatically as soon as they become available. I got the basics done. But i cant get to add torrent to deluge via deluge-console. The ...
0
votes
2answers
116 views

Open a file at a certain position and read one byte in bash

Since two persons already voted to close this post, I'll try to make the question as clear as possible. A file on a physical device is represented as a binary sequence. That being said, what I need to ...
1
vote
0answers
12 views

bash - using lftp to mirror specific files from remote folder

I want to mirror files from a remote directory via ftp. The following code works: lftp -c 'open ipaddress; user myusername mypassword; mirror -e /files/ /home/user/files/retrieve/; quit' However, ...
0
votes
1answer
23 views

Run any bash script in Terminal application from within file manager context menu?

this question is simple about "Open/Run in Terminal".... Looks Ubunutu doesn't support bash/shell-scripts the way we know from KDE and any other OS: I tried the obvious: Right click in file ...
1
vote
2answers
52 views

Can i call Cpp Program in Bash file?

I am new in Bash Programing... I wanna call my C++ Program in Bash file. my prog is: myProg.cpp #include<iostream> using namespace std; int main() { cout<<"Salam! World"<<endl; ...
1
vote
0answers
16 views

How do I run as bash script from a WebApp?

I currently am developing a custom Ubuntu dist. that runs a dedicated Kiosk app upon boot. I would like an easy method to shutdown from inside the Kiosk app, but I am currently at a standstill at what ...
0
votes
1answer
21 views

Script is not pausing until I type soff

The script is automatically calling the signoff script instead of pausing until I type "soff"? Also a user should not be able to start this script "signon" again while it is running. Below is what I ...
1
vote
2answers
51 views

Is there a command to round decimal numbers in txt files?

I saw this post, but I was wondering if there is a simpler command to round decimal numbers. I have a file with milions of numbers: 0.1 1.2 3.8 I want to round them to integer 0 1 4 Is there a ...
2
votes
1answer
69 views

What are the differences between executing shell scripts using “source file.sh”, “./file.sh”, “sh file.sh”, “. ./file.sh”?

Have a look at the code: #!/bin/bash read -p "Eneter 1 for UID and 2 for LOGNAME" choice if [ $choice -eq 1 ] then read -p "Enter UID: " uid logname=`cat /etc/passwd | grep $uid | ...
3
votes
4answers
6k views

bash profile works for user but not sudo

I've modified my .profile to include a folder if a flash drive is plugged in. When running the command as the user it works fine but tells me the scrip must be run by sudo (this is what i want). ...
0
votes
3answers
63 views

Linux equivalent for «cmd /C start “Title” “C:\Folder\file.bat”» [duplicate]

I have a Java program that runs a batch file on Windows with Runtime.getRuntime().exec() using the following command: cmd /C start "Title" "C:\Folder\file.bat" The Java program ends quickly since ...
1
vote
1answer
19 views

How to print an octal value's corresponding UTF-8 character in bash?

I expected printf %s '\<octal_character_value>' to do the trick, but it doesn't: printf %s '\101' Outputs: \101
3
votes
1answer
128 views

Bash History Search (CTRL+R) in Ubuntu Suggestions?

Bash has a great incremental history search with CTRL+R. However, using that is evidently tied to being in a bash. Ubuntu, on the other hand, has this nice global search tied to the Windows key (in ...
0
votes
0answers
23 views

copy an entire vm to dvd/cd disc?

I am writing a series of scripts on ubuntu for process control. I have needed to install several packages such as gawk and stress. I am doing this for a university project and will need to submit it ...
9
votes
7answers
802 views

How to display the paths in $PATH separately

I cannot figure out how to list the various paths in $PATH separately in so that they look like this: /bin /usr/bin /usr/local/bin etc. Does anyone know the correct variable for this?
1
vote
1answer
19 views

Bash script behaves fuzzily

I'm using this bash script to check if the content of two paths install and install1 passed as arguments is the same: #!/bin/sh du -a $1 | grep -Po "[0-9]+\t$1/\K.*" | sort -n > list.txt du -a $2 ...
-2
votes
0answers
28 views

backup script located in root's home directory [on hold]

Create a backup script named backup.sh located in root's home directory which will use tarwith gzip compression to back up the files located inside /etc (including /etc itself and its subversion ...
25
votes
4answers
40k views

How to change extension of multiple files from command line?

I have many files with .abc extension and want to change them to .edefg How to do this from command line ? EDIT: I have a root folder with many sub-folders, so the solution should work -r ...
3
votes
2answers
287 views

How to run a bash .sh after starting a program in PlayOnLinux?

I have a little script that needs executing every time I open a wine program. The script is pretty simple: #!/bin/bash xdotool windowmove 67108871 1440 0 How do I get PlayOnLinux to run this script ...
1
vote
0answers
31 views

How to compile Zoneminder source files [migrated]

I'm trying to make a video surveillance system with my Raspberry Pi (running raspbian) using Zoneminder. Default action of Zoneminder is only to send an e-mail but I want also to run a script which ...
1
vote
1answer
33 views

Check if a screen is active and then display countdown

#!/bin/bash DATE=$(date +"%m-%d-%Y") Backup_from="/home/mc/server/prison/" Backup_to="/home/mc/backups/PRISON-$DATE.tar" echo "Starting backup of $Backup_from to $Backup_to" screen -dmS backup tar ...
1
vote
1answer
29 views

Custom environment with gnome-terminal

I tried to put this into the startup applications: gnome-terminal --working-directory /media/Data/work/ -e '. .env/bin/activate' where .env/bin/activate represents my virtualenv. For some reason, ...
5
votes
2answers
131 views

How to use zenity file selection

I am new to zenity and I am trying to make a simple script for loading a file using zenity --file-selection and the wc command to get the word count of that file. I have successfully made a form which ...
1
vote
3answers
379 views

How to install RevKit

I’m trying to install a software called RevKit on Ubuntu 12.10 and the following instructions1 need to be followed: RevKit can be downloaded from the www.revkit.org website. Opening a Bash ...
0
votes
0answers
10 views

How can I remove the ubnoxious subscript that appear on some torrents

Hi I would realy like to know if there is a terminal command to remove the writing that sometimes appear on torrents like the banner titles and so on
-3
votes
0answers
27 views

Print second vowel using provided loop!

FS=$'\n' for j in `cat $1`; do #Reads the text file in the centre of the screen echo " ___________________" echo " ...
0
votes
2answers
67 views

Print second vowel in word in red color

How do I print the second vowel in a word in red or blue color. Let say I execute my script called "script1" which reads a text file. My script should be able to print the second vowel in every word ...
74
votes
7answers
134k views

How do I create a permanent Bash alias?

I would like to create an alias to rm command in order to have a confirmation message after executing this command. So I am creating an alias like this alias rm='rm -i'. But as far as I know this is a ...
1
vote
1answer
19 views

Using variables as paraments for commands in a bash script

I currently have a bash script which I can simply double click to remote desktop into my institution: #!/bin/bash xfreerdp -f -u myusername -d campus -p mypassword --ignore-certificate website.com ...
0
votes
1answer
44 views

awk print output redirection

I am writing a bash script, and in that bash script I have a line similar to this: awk '/TextToBeMatched/ { print; print "TextToInsert"; next }1' "/Path/to/specified/file.extension" And currently ...
-1
votes
1answer
39 views

Display specific characters in specific time from a text file

How can I display a specific number of words or characters in a given time using a loop. Lets say I want to display 120 words in one minute. Here is the loop i have tried: FS=$'\n' for j in `cat ...
4
votes
2answers
179 views

Print only one line at a time from text file

how can I print or display only word from a text file at a time. When I run my script it should only display each word from the text file one by one, but only display that word. This is what I have ...
0
votes
2answers
46 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
votes
0answers
39 views

bash ssh warning when connect to raspberry: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

First of all, I would like to tell you that I have tried so many solutions for my problem, but none of them helped me. (I tried for example this: http://ubuntuforums.org/showthread.php?t=1346581 and ...
0
votes
1answer
15 views

Templates directory in Ubuntu: can I use this feature with gedit in bash shell?

Saw this question: What is the "Templates" folder in the home directory for? But I wanted to know whether I can use this feature with gedit in bash shell? If yes How? If no is there any ...
0
votes
0answers
63 views

Permanently adding folder to PYTHONPATH [on hold]

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 ...
3
votes
4answers
67 views

How can I divide output with delimiter?

I would like to change: e·ver·y·bo·dy to: e·ver·y·bo·dy e·ver·y·bo· e·ver·y· e·ver· e· A for loop will be greatly preferred.
0
votes
1answer
42 views

Bash script in terminal on boot

Is there any way to run a .sh script in a terminal window on boot? My computer boots slowly and I want to be able to press the button and leave to save a lot of time. This script is a looping ...
0
votes
1answer
133 views

Batch processing folders with `find` and imagemagick's `montage`

So I've been working at this for a while and I think I'm ready to give up. I trying to process sub-folders with imagemagick's montage to create contact sheets. This is basically as close as I've ...
2
votes
1answer
9k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
1
vote
1answer
39 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 ...
0
votes
3answers
50 views

Substitute specific char sequence inside filenames

A friend of mine grouped tons of files in this way on windows After I made him switch to Ubuntu, files are no more ordered based on the number of exclamation marks in front, so I would like to know ...
2
votes
0answers
21 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 ...
18
votes
4answers
3k views

how to get bash to stop escaping $ during tab-completion?

I have this on the command line: ln -sf $PWD/wine- and then I hit tab to complete the filename. In earlier versions of Ubuntu, this worked just fine to complete the wine- filename (and as a ...
1
vote
4answers
44 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 ...
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 ...