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 (4)

0
votes
1answer
24 views

bash storing array variables in rotation

My objective is store values in array , as below: arr[0]=apple arr[1]=banana arr[2]=orange arr[3]=grapes arr[4]=apple arr[5]=banana arr[6]=orange arr[7]=grapes arr[8]=apple arr[9]=banana I can ...
1
vote
3answers
48 views

How can I automatically try a specific resolution if I connect an (any) external monitor?

Is there any way to configure Ubuntu to set default "first-try" monitor resolution whenever a (or two) monitor plugged in. Regardless of what graphic cards or graphic driver that being used. For ...
1
vote
1answer
12 views

How to restart gnome shell but daemonise it from a script? [duplicate]

I have a couple of scripts to work around Gnome Shell's inability to work well automatically when swapping between FHD (1080p) and UHD (4k) screens. I set various things with gsettings, restart nemo, ...
5
votes
3answers
654 views

A script for copying random folders

I'd like to realize a little project I've always had in mind. I have a vast music library on my desktop and I'm looking for a way/script to select a random amount of folders (say, 25 albums) and, if ...
1
vote
0answers
14 views

notify-send not showing popup message

I have a script which executes on certain conditions, whenever I manually execute the script, the popup appears, however if i try to aumotate the script(i.e. run the script right after system is ...
0
votes
1answer
22 views

SSH fails in Crontab after reboot

I am regularly running a shell script through Crontab that uses SSH to connect to a server. If I run that script manually it runs through successfully. Within the same session Crontab will ...
0
votes
3answers
22 views

How to run a Python script not as '~$ python myscript.py' but as a single command '~$ myscript'? [duplicate]

I have a Python script which takes command line arguments. When I want to run the script I have to navigate to its directory and run: python myscript.py [arguments] How can I run it like: ...
0
votes
0answers
15 views

start script after resume as logged in user (not root)

I'm running owncloud client in Ubuntu and after a suspend/resume there's a bug in owncloud which makes it not be able to connect to the server. I wrote a little script which should restart owncloud, ...
0
votes
1answer
22 views

Script not running on resume/wakeup in Ubuntu

I have a script named 999_thaw_flash.sh in my /etc/pm/sleep.d The script follows like this :- export DISPLAY=:0 #!/bin/bash case "{$1}" in resume|thaw) lynx --dump link1 >> file1 lynx ...
0
votes
0answers
28 views

I have a problem with a loop in a script. How I can create a loop in a loop?

I'm doing a script for improving my scripting capacities, but I can't make a loop work, how I can fix it? Here's the script: As far as my knowledge go, the problem is in the read op2; while [ $op2 ...
0
votes
0answers
14 views

reboot bash script for Beaglebone stops without finishing

For the longest time I used the following script: #!/bin/bash echo 'start' && ssh -o 'StrictHostKeyChecking no' root@192.168.7.2 'reboot'&& echo 'end' which echos "start" and also ...
1
vote
2answers
16 views

How should I set enviroment variables at GNOME login - not shell?

Ubuntu 12.04, GNOME Classic I have a script that I execute from /etc/bash.bashrc. Whenever I open a terminal, it sets some environment variables needed for my applications to run. I execute them from ...
0
votes
0answers
10 views

Scripts for disabling and enabling proxys are not working [duplicate]

I have following scripts for enabling and disabling proxys, but looks like they are not working. Do you guys know what might the problem be? enableProxy.sh #!/bin/bash export ...
6
votes
4answers
398 views

How to detect the number of opened terminals by the user

I am using Ubuntu and can manually change the bash shell prompt color to green using export PS1="\e[0;32m[\u@\h \W]\$ \e[m" However, I want the shell prompt color to automatically change whenever ...
0
votes
0answers
21 views

Why is xinetd so slow?

I'm using an aws ubuntu distro (small size) to receive webhooks from github. The basic setup is to use xinetd to kick off a small bash script to read the post data in from github. If it's a ...
0
votes
0answers
20 views

Is it possible to use variable for zenith with single quote

What I tried to do is to show files installed to ubuntu, using zenith. Files installed are depending on other thing. So the text content shows with zenith is set to be a variable. But with my ...
-1
votes
0answers
12 views

Java HotSpot(TM) Client VM warning in linux VM

I am new to Ubuntu 14.I need some one help on the below issue. I am installing MFP domain on Vertual machine using rpasInstall.sh script, but it is failing with the below error. Java HotSpot(TM) ...
3
votes
2answers
41 views

How to write a script to toggle unitytweaktool setting (hotcorners)

Specifically, I want to toggle hotcorners on/off every time I start a steam game. But I have no knowledge of scripts of any kind. Any resources to learn this kind of stuff would be great. Please ...
0
votes
1answer
25 views

Create double click executable file

I would like to create a file, which could be saved in the Desktop or in another folder, which upon a user double click on it executes some commands, one of which should be as super user (sudo) and ...
0
votes
2answers
37 views

Bash scripting problem on echo -ing the current working directory

I have this code: #!/bin/bash #clear screen clear # Ask for name of directory to create echo "Please enter a directory name" echo "that you wish to create" read dir1 # create directory mkdir ...
0
votes
0answers
29 views

Copy/move a list of files to a directory while maintaining directory structure

I have Ubuntu 14.04 os installed in my system. Now I need to create a script for copying/moving a list of files and directories of a Magento module to another main parent folder along with ...
2
votes
1answer
47 views

Script to convert .wma to .mp3 command not found [duplicate]

I am using a script called conv-script that I found on AskUbuntu here. It looks like this #!/bin/sh readarray -t files < wma-files.txt for file in "${files[@]}"; do out=${file%.wma}.mp3 ...
0
votes
0answers
14 views

Sensu remediation: not able to trigger client

Sensu Monitoring.... Senario: if my http link goes down then i use to manually run the script and start it. we moved to Sensu recently as its GUI and monitoring system is quite impressive ,I tried ...
1
vote
0answers
47 views

Not able to execute a url from python script running via Cron

I have a script web.py which I am trying to run on the aws EC2 Instance using cron. It basically has these line of codes: import webbrowser webbrowser.open('http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx') If ...
0
votes
1answer
19 views

Can (or should) a script perform a login?

I have a nightly process that SFTPs files from a Windows server to our Unbuntu server (12.04.5 LTS) using my username and login. A script setup via cron (sudo crontab -e) runs later to copy those ...
0
votes
0answers
48 views

Irrevocably shutting down our computer for the night

Is there a utility, script or other possibility to create an irrevocable shutdown utility, that will turn off my laptop once I started, no matter second thoughts that I might have ? Additionally I'd ...
0
votes
1answer
23 views

How to run a C++ program in python as a root? [closed]

I want to run a C++ program at boot with root privileges, I could not find how to do it. import subprocess def run_c_program(); subprocess.call("/home/pi..../example") When I run the ...
0
votes
0answers
24 views

Errors logs for MAAS commissioning?

I am trying to get some things to work with MAAS. I have hits some brick walls (hard!!), but in the end you will learn right ;) So what I want to do is to make MAAS start the machine with etherwake. ...
3
votes
2answers
412 views

Make a Startup message

I just wanted to ask, if there is any way to create an error message that shows up after login and if I could combine it with a script to check the Internet connectivity.
0
votes
0answers
86 views

Need script to logout after 20 minute idle time and then auto login

I have a public internet terminal at my workplace. Often, users will simply walk away from the machine without logging out (of email, facebook, etc.) -- I want to make the end-user experience more ...
0
votes
0answers
8 views

What is the meaning of the highlighting in the terminal? [duplicate]

I use ubuntu for about half a year, but I'm still a newbie regarding the terminal. So could someone explain me what the exact meaning of the highlightings in the terminal is? I only know the ...
-1
votes
0answers
13 views

How to autostart shell script MobileTerminal create application

I have a jailbreak iPhone I have installed MobileTerminal I always must typing the command to start the application Can you make application that by clicking on it also opens MobileTerminal without ...
1
vote
0answers
38 views

Compress a folder but skip compressing specific file types and include them as such

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~190 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
0
votes
1answer
31 views

TVShow Renamer Run Solely Through Bash/Terminal

I come from Windows and used therenamer religiously. Is there something similar that can be used on Linux (I saw filebot...maybe) that can also be used through a bash script/terminal commands? ...
1
vote
0answers
27 views

Get a list of all scripts and their paths which are run as cron job

I am looking for some script or terminal command to list all the scripts (preferably with their paths) which are run on a periodic basis by cron, cron.daily, anacron. I am not looking for any filter ...
2
votes
2answers
43 views

Add Guest account created during login to certain groups?

This question is related to another, more general, question about guest accounts. This one is very specific. Setup: I have many older Dell Latitude E6410s and some newer Dell Latitude 5450 I use in a ...
0
votes
0answers
26 views

Edit /etc/environment via Command Line [duplicate]

I am using Ubuntu Server 14.04 and I would like to be able to edit the /etc/environment file via the command line to append the file with environment variables. This append operation is going inside ...
1
vote
1answer
27 views

Recursive Scan To Move All Files And Deleting Empty Directories

I am learning bash scripting and want to move all *.ort files to a new directory and delete the directory once the .ort file is moved. To Note: I do not need to keep same structure - I want to move ...
1
vote
1answer
21 views

Script Appends Extension Twice

I am running a quick bash script that will convert any .mov files to .mp4. This works great 99% of the time, but sometimes I hit a snare and I get an error of: the file ...
0
votes
0answers
16 views

The upstart at least a shell script

What 's wrong with my upstart configuration files? I want VAL = 1 as a result of result.txt. /etc/init/test.conf description "test" start on startup script if [ $(cat /test.txt) == ...
1
vote
1answer
91 views

python hashlib fails to install pip

I have a script that depends on hashlib, but when I try sudo pip install hashlib I get this: $ sudo pip install hashlib Collecting hashlib Downloading hashlib-20081119.zip (42kB) 100% ...
8
votes
2answers
246 views

Is there a “don't disturb” option to temporarily hide notifications, like on macbooks?

Does there exist "Don't disturb mode" as is does for OSX device, where you can decided when notification can bother you, or not.. I just installed chrome, and I usually get spammed by group texts ...
1
vote
0answers
33 views

Scripting dconf changes

I've written a simple script for our Ubuntu machines at college which sets some dconf overrides to set the theme, background etc. However I cannot seem to get it to correctly set the login screen ...
0
votes
1answer
25 views

My bash script doesn't work when triggered by crontab, but works when i trigger it manually?

this is the cron entry */1 * * * * ./home/usr/automation/check_rejected_files.sh > /home/usr/automation/cronout it produce the file but nothing else happen, i added a date log in the beginning ...
0
votes
0answers
25 views

Shutdown multiple minecraft servers with a script

I have multiple minecraft servers running on an ubuntu server. All of them are running in a screen belonging to their according user. I currently have a server running in a screen owned by user ...
0
votes
1answer
20 views

how to get 2 epoch time value in varibale

If I am running this command from command prompt its fine but how to put it in shell script ? Basically this command is subtracting 2 epoch time but I need their output value in a variable. date -d ...
2
votes
1answer
246 views

Bash 12 - 08 Value too great for base (error token “08”)

So, I'm trying to calculate 12-08 (not 12-8) and get the following error: let: 08: value too great for base (error token is "08") Here's the sample code: first=12 second=08 if [[ ($first > ...
2
votes
1answer
37 views

pyosd works with interpreter , but not with a script

I am working on a script that would display arbitrary system information on screen. For that purpose I've been trying to use pyosd module. Consider the following 3 lines: import pyosd p = ...
-1
votes
1answer
77 views

How can I open multiple html files with gedit from a script?

I have a list of HTML files I use for writing. I would like to script to open them for editing. HTML files are associated with Firefox as the Default Application on my system. New to Linux and ...
0
votes
2answers
30 views

Script to enable “source” downloads in a deterministic manner

I wrote a couple of scripts to help users pull their current kernel source package, apply some patches of mine, and build it as a .deb package with make-kpkg. One of the few steps that requires manual ...