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

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Cannot create dir, in bash script. Set a wrong variable?

HI I try to run a script for loadleveller on UNIX machine. My intention is to create script, which can create at first work directory on /gpfs/scratch/user/jobid where jobid is the sequential ...
0
votes
1answer
32 views

How can I split a line in 2 by words/characters? (Bash) (Regex)

I would like to convert: Hello Hello Hi Hello Hello Hi Hi Hi Hi Hello To: Hello Hello Hi Hello Hello Hi Hi Hi Hi Hello I want to split a single line in 2, by having them have the closest amount ...
1
vote
3answers
29 views

How to add executable bash script on ubuntu startup

I have created a executable bash script (using chmod +x) for monitoring my system and it works perfectly with out any error. Now i want to add this script on my start up in order to executing the ...
0
votes
0answers
21 views

sed error Bash script

So here's the deal I'm trying to do some auto editing of a file with sed in a bash script. Here's my code: systemdate=$(date) sudo mkdir "/tmp/autoupdate" sudo echo "$systemdate" > ...
0
votes
1answer
18 views

How to execute a script from trusted shell

I am new to Linux. I have copied the bash program from bin to a thumb drive. I have renamed it to "ebash". Now I connect this thumb drive to other Linux machine. I have mounted this drive and ...
0
votes
3answers
46 views

Help with a Bash script or some program to sort files and move to different folders

is there anyone out there who can help me sort some files with a bash script or terminal commands (or even a little Java program) that can be used to sort and and move files to new folders? I have ...
2
votes
1answer
28 views

Join two files keeping the element order of one of them

I have two files File1 03873 03872 03871 03870 ...... File2 00001 0.867 00002 0.855 00003 0.864 00004 0.855 ... 03870 0.825 03871 0.852 03872 0.326 03873 0.852 I want to ...
3
votes
4answers
45 views

Replace string with multiline file content

I need to replace string SALT in a file with content of another file. Problem is that the input file has multilines. I tried something like this in my bash script: SALT=`cat salt.txt`; sed ...
1
vote
0answers
11 views

Unresolved dependenices after trying to reinstall ROS

I tried to re-install ROS because of issues with not finding system paths correctly and now all I can see is a black screen when I turn on the computer. In tty1, when I try sudo apt-get install ...
0
votes
2answers
53 views

Navigate the web with the terminal

I'm trying to learn how to use the terminal, and I want to try sending and receiving data from a common website like Amazon or Google. I want the terminal to enter a string into a website's search ...
0
votes
0answers
28 views

How to I clear bash history completely in Ubuntu 14.04?

How do I completely clear bash history from Ubuntu 14.04? I tried the command "cat /dev/null > ~/.bash_history" and other commands I found, such as "cat /dev/null > ~/.bash_history", but none of ...
4
votes
1answer
92 views

How to clear system tray notification via command line

I have an application which produces system notification every 5 seconds. Overtime the notification tray I have (Gnome env) gets crowded. How can I clear it like every minute but I need to do this ...
0
votes
1answer
17 views

Sublime Text does not launch under gksudo

Sublime Text does not launch under gksudo. If I start it directly sudo subl it works, but gksudo subl fails. Also, how can I get a list of programs that can run from terminal straight away ...
0
votes
0answers
18 views

How do I remove W: Duplicate sources.list entry [duplicate]

W: Duplicate sources.list entry http://download.opensuse.org/repositories/home:/osmc/xUbuntu_14.04/ Packages ...
0
votes
1answer
33 views

Packaging bash script with dh-make

I have installed dh-make by installing other packages as recommended by this page which depend on it (I am listing all packages which could have installed it as well because I am not certain which one ...
0
votes
1answer
34 views

shell script for wifi connection via terminal

How to write shell script that will automate interactive steps to connect to wifi via terminal? Steps outlined in How do I connect to a WPA wifi network using the command line? with further details: ...
2
votes
3answers
175 views

How to label occurences of text?

I would like to convert blue blue red green to: color.1=blue color.2=blue color.3=red color.4=green Any leads on how to tackle this? sed, awk, etc.?
0
votes
2answers
27 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
vote
1answer
31 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, ...
1
vote
1answer
26 views

cannot exec 'anything' : no such file or directory screen

I’m running some call of duty game servers with screen. I have a start.sh: #!/bin/bash user=cabe game=cod verision=cod1.5 server=xxx.xx.xxx:28970 mod= ip=xxx.xx.xxx port=28970 punkbuster=1 ...
1
vote
0answers
21 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 ...
-1
votes
0answers
31 views

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

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
48 views

Run script in Terminal via context menu (Open with Terminal)? [duplicate]

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 ...
0
votes
1answer
23 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
55 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
2answers
52 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 ...
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
0
votes
0answers
26 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 ...
0
votes
1answer
16 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
129 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 ...
2
votes
1answer
75 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 | ...
0
votes
3answers
71 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
22 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
39 views

backup script located in root's home directory [closed]

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 ...
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
37 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, ...
-1
votes
0answers
17 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
11
votes
7answers
890 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?
-3
votes
0answers
31 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
71 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 ...
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 ...
5
votes
2answers
136 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
votes
1answer
47 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 ...
0
votes
1answer
45 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 ...
4
votes
2answers
187 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 ...
-1
votes
0answers
55 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
1answer
44 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
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 ...
3
votes
4answers
69 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.