Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms (3)

5
votes
1answer
53 views

A sleep script for Ubuntu server

Let's start from the beginning: I have a Pi which wakes up my server when a request comes in on tcpdump, and it works like a treat! My problem is that I want my server to sleep when there is no ...
0
votes
2answers
42 views

Find and Replace with Bash

I'm trying to replace some text with other text in a configuration file. I created a script with the sed command but I'm getting an error. Original Line: <property ...
0
votes
0answers
34 views

Shutter custom filename fails when called from script

I'm having some trouble with Shutter, I don't know if my shell or shutter is guilty of such behavior. I can call shutter from command line successfully : shutter -e -s -o '/tmp/screen_%NNN.png' ...
0
votes
1answer
99 views

How do I add custom items to the context menu in Dolphin in KDE 5?

I've Googled around, but can't seem to find any consistent tutorials or documentation that describe how to do this (in my case, on Kubuntu 15.10). I want to add custom scripts to the context menu in ...
0
votes
1answer
31 views

shell script to move a set up folders into one folder and timestamp it

I have a set of folders (let's assume at /home/20161, /home/20162, /home/20163) which have been timestamped already. at the end of the day, I'd like to collect all of them and move to a main ...
3
votes
1answer
53 views

Script to copy files with desired name

I've got a problem i'm facing for 6-7 hours and i can't overcome it , that's why i'm asking for your help.I need to create a bash script that accesses a folder and renames all the files from it with a ...
1
vote
3answers
287 views

Somehow I created a nondeterministic sh script

I created the following script: #!bin/bash cat > Top10 <<EOF Linux Mint 17.2 Ubuntu 15.10 Debian GNU/Linux 8.2 Mageria 5 Fedora 23 openSUSE Leap 42.1 Arch Linux CentOS 7.2-1511 PCLinuxOS ...
3
votes
3answers
57 views

How can I reorganize files by extension, and sort them into folders by category?

Below code was posted by @JacobVlijm. I've tried to modify it, because I want other folder names then the file extensions, and I'd like to group file extensions into categories. The code does not work ...
1
vote
0answers
14 views

Update apache/admin password in multpile folder

This is great work very well done. I have a problem too it is requested that you inform me how can do this. Let say i have folders named Folder1/apache/users/admin Folder2/apache/users/admin ...
0
votes
0answers
12 views

Detached process dies with terminal [duplicate]

I wrote a script to get around a problem with the volume indicator on my ubuntu mate 15.10 system (pulse audio sometimes doesn't start, not a clue why, but it will start after a try or two). I have a ...
2
votes
2answers
117 views

How can I easily scale a screenshot, taken from a high-DPI screen?

Since I switched to a High DPI display, the screenshots I post are awkwardly big, example below. Is there a way to quickly make them look normal? Preferably something faster than firing up GIMP. In ...
0
votes
0answers
34 views

Number patter counter needed in Python

I have a ultrasonic senor when entered this script (it’s a bit too long to past it in here) I get lots of numbers printed out (every 1 seconds). These numbers are between 0cm to 700cm, however ...
1
vote
1answer
43 views

script not working

I'm very new to linux, I'm trying to get names of .ogg files from a text file and take mp3 files of directory music and rename and move them to a different directory with the name of that file line by ...
0
votes
0answers
9 views

Need to access old EXT4 boot drive as a R/W EXT4 from new EXT4 boot system

Installed 12.02 some years ago on EXT4 platform. Over time lost audio and alt+ctrl+t doesn’t open text screen any longer. Upgraded to 14.04.2 and system boots OS but no repairs were made. Have set ...
1
vote
2answers
41 views

Pass Variable Value as Argument to Command

I want to let xdotool type the current date automatically and wrote this bash script as a first try: #!/bin/bash STR="Hello World!" xdotool type $STR Unfortunately, it already fails at ...
0
votes
1answer
35 views

How to see current interface/wifi speed

I can see the download and upload speed for all interfaces using glances. In the network section we can see the Rx/s and Tx/s columns where I can see the value in Mbps. However I want to store this ...
-1
votes
1answer
39 views

How to automatically “live” synchronize a single file in one direction

How can I use a script to automatically and immediately update the backup of a single file?
4
votes
1answer
78 views

Launcher placement dual-monitor

I have two monitors. I have multiple workspaces. I want my launcher ("launcer placement" in settings > displays) to be present on both my monitors in the one workspace, but have only one launcher (on ...
0
votes
0answers
10 views

Error executing javascrit file through nashorn jjs

I can execute jjs on bash $ jjs jjs> but I can not execute script $ ./executable.js /usr/bin/env: jjs -scripting: No existe el archivo o el directorio executable.js #!/usr/bin/env jjs ...
1
vote
0answers
23 views

Sort file into directories base on their extension [duplicate]

I just recovered more than 2 Million files using PhotoRect, the files in the recovery folder contain more than 2 Thousand folder containing random files extension . It would be impossible if I sort ...
0
votes
1answer
45 views

Help debugging my bash script

I wrote a script (my first one) that aims to replace an IP address in a bind configfile whenever it detects that the IP that appears in the file is not the same as the current external IP. I have my ...
0
votes
0answers
15 views

How to set up MailMerge for Google emails under Ubuntu 14.04?

I want to send out group emails and have each person addressed by their first name. I've got those groups in the Google Contacts. The only info I found on this Forum applied to T'bird. Would the ...
5
votes
3answers
602 views

Why do some python scripts begin with #!/usr/bin/env python? [duplicate]

I noticed that some python scripts start with #!/usr/bin/env python instead of #!/usr/bin/python. Are python scripts the only ones that use #!/usr/bin/env? Are there any scripts that start out with ...
0
votes
1answer
46 views

Please explain what does following command mean:

awk -F'[ ()+:]+' ' I use it in my script. With this case I can take the time in brackets from for example: Fri Dec 18 11:13 - 11:15 (00:02) Fri Dec 18 09:11 - 19:42 (1+10:31) But how does it ...
3
votes
1answer
34 views

Mysterious behavior of echo command

When we need to use escape sequence characters with echo command we must use the -e option. Like echo -e "Enter your name : \c" But when we include such kind of statements inside a shell program ...
7
votes
3answers
127 views

How to lock screen 30 minutes after unlock [duplicate]

I would like my children to only use the computer for 30 minutes, at which time I would like the screen to be locked. At that point, if I choose to unlock the screen again, I would like the screen to ...
0
votes
0answers
24 views

How to keep read value after break [duplicate]

Evening, I am trying to have the mysqlpass entry stay throughout the script, without the break getting rid of it. But I can't figure out how. while true; do read -p "Password for MySQL " ...
0
votes
1answer
41 views

How can I write to stderr so that stderred colours it red?

For background, I previously asked this question. I am using stderred to turn stderr text in red when diplayed on a terminal. This works nicely on most occasions, more specifically for what appear ...
3
votes
1answer
110 views

How to use `scrot` to take screenshots of a particular window by name?

If I would like to select a window for scrot this could be easily done with: scrot -s name.jpg But if I want to ask scrot to keep taking screenshots from a selected window, then I don't know how to ...
0
votes
1answer
47 views

Cronjob permission denied (Nightly backup shell script)

I am trying to create a shell script to make a backup every night using tar. The error I get is: From shady@wserver1 Wed Dec 30 04:01:01 2015 Return-Path: <shady@wserver1> X-Original-To: ...
0
votes
2answers
45 views

Running Teamspeak 3 on Ubuntu 14.04 issue

I tried installing Teamspeak 3 and got up to the point where I run ts3client_runscript.sh and changed it to run as a program. However, it still opens with Gedit. Can someone help me please.
5
votes
2answers
400 views

Bash script — store `curl` output in variable, then format against string in variable

I was hoping to curl data into a shell script variable, then use cat or awk to operate on that variable as if it was a file. Is this possible, or is there a workaround? Do I have to save the curl ...
0
votes
0answers
14 views

Automated backup script no longer running after upgrading to 14.04.3

I have a backup script that flawlessly backed up my system on an hourly basis, until I upgraded to Xubuntu 14.04 from Xununtu 12.04. I did not initially notice, since I just assumed it would keep ...
3
votes
1answer
56 views

Running bash script in detached screen

I could use a little help on this one. I am a novice scripter at best. I am trying to write a bash script to connect to my multiple openvpn sites. I am trying to write the script to open in a ...
0
votes
1answer
39 views

decrypt encfs on startup

I would like to decrypt an EncFS "volume" on startup. Usually I decrypt the volume like this : cat "/home/user1/encfs.pw" | encfs -S /mnt/encryptedVolume /mnt/decryptedVolume In /etc/init I have a ...
1
vote
1answer
31 views

How to properly install steambp

I'm new at Ubuntu and very eager to learn the ropes. I´m having a bit difficulty working the Terminal though. I'm running Ubuntu 15.10. I am trying to install this awesome GRUB modification ...
7
votes
3answers
175 views

Same script opened in three different ways produces three different results. Why? [duplicate]

I have a sample script (credit goes to kos): #!/bin/bash cat <(cat /etc/lsb-release) I save this script as somename.sh in my home directory. Now, I try to open this file in three different ...
0
votes
0answers
22 views

how to find a file and ftp from ubuntu server?

I am not a unix scripting guy, so I have this question to you all. How I can find a file and ftp it to a ftp server? ncftpput -R -v -u "username" x.x.x.x xyz/ Downloads/[find /home/owner/Downloads ...
0
votes
1answer
63 views

How do I create a simple loop daemon bash script? [closed]

I want to create a simple daemon bash script that will run a command if my computer is inactive for more than 10 minutes. I created an alias to run a python script in the terminal, and I plan on using ...
0
votes
3answers
91 views

.sh files won't run, even after permission given [duplicate]

I have had a long history of not being able to run .sh files. I don't understand what the underlying problem is,(I'm a little bit new to Ubuntu/UNIX based systems). When I try to run certain .sh ...
1
vote
1answer
21 views

how to handle unwanted exiting of a command and its output in bash script

I made a one liner script to auto hide a specific window when mouse is not hover over that window. It gets mouse position and geometry of the window and its position (topleftx,toplefty), I added its ...
3
votes
0answers
33 views

Why isn't my script running? [duplicate]

I'm trying to create a script to automate the setup for my Plex server, but it's not working. Here's the script: #!/bin/bash #makes backup of /etc/fstab and /etc/network/interfaces cp /etc/fstab ...
1
vote
0answers
14 views

How to redirect sound file output to computer sound input while still able to hear other input?

I have a sound file with some music, and I want to call someone on qTox and play it to them so that they can hear me, but also the sound file. However as I only have a built-in laptop microphone it ...
0
votes
1answer
58 views

How to use Read command in shell script while run script on remote machine [duplicate]

I want to run my shell script on a remote machine and I need user want to give value for some variable for that we use Read command while run script on local machine but I use the same command while ...
2
votes
1answer
54 views

Using user input to determine how many times a for loop iterates

I am having difficulty getting a for loop to take user input in the form of an argument to a function I created. #!/bin/bash number1="$1" #Assume user input 5 loops="$2" #Assume user input 5 ...
0
votes
0answers
24 views

how to check hardware integrity on Ubuntu server

I see this thread, and for Ubuntu desktop editions, it is fine. Is there a way to check hardware integrity? I am running Ubuntu server, on a dedicated machine, and I'm concerned about the SMART disk ...
0
votes
2answers
71 views

Select Command not working while run shell scripts on remote machine

I want to run my shell script on a remote machine and I need user want to give value for some variable for that we use Read command while run script on local machine but I use the same command while ...
0
votes
2answers
37 views

How to add line to file using terminal

I am new to linux. I want to make a automated script for compilation of cm11 form my device and this is my script #/bin/bash cd cm11/.repo/ rm -rf local_manifests mkdir local_manifests cd ...
3
votes
1answer
232 views

proper syntax for grep: search a string, copy two rows above and transpose

Am new (2 days old) to Linux and grep and am stuck here. Scenario. I have data lasting more than 10yrs which I have been doing manually until I came across grep. The folders are of form \yyyy\mm\dd ie ...
4
votes
2answers
164 views

Problem with input from simple script that copies a file to a different directory

As someone trying to learn bash, I have been making simple scripts to test out various commands. In the following simple script, I am experimenting with the read command. #!/bin/bash read -p "Enter a ...