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)

0
votes
0answers
48 views

error: 'xxx' directory does not exist

I'm trying to compile a file by using the Allwmake command. but i got this error in my terminal : mohsen@mohsen-MS-7599:~$ ...
0
votes
0answers
16 views

Concatenate AVI videos with same format on the command line [duplicate]

I want to create a script to concatenate AVI videos, all with exactly the same format, frame rate and resolution. I don't need any editing, only concatenate all the videos in each of the folders. The ...
0
votes
0answers
28 views

How can I modify this script to only copy certain file types? [on hold]

The script is here: How can I automatically copy the content of a usb (flash) drive to another directory? I would like modify the script to only copy media files (jpg, png, mov, avi, wmv, mp4). ...
0
votes
0answers
25 views

Odd Illegal Variable Name error in csh script

I have a peculiar problem with a csh script which occurs only in my Lenovo Z500 laptop. I have run the script in 3 other computers with analogous operating systems (Kubuntu 14.04 x64) and the only ...
0
votes
1answer
44 views

Ho can I make sure a program is killed when VPN is running?

There is a program that I need to not have running whenever my VPN is running. I don't want to resort to closing it manually every time, because I might forget sometime. I would like to guarantee ...
1
vote
0answers
10 views

Shell script to create multiple accounts? [duplicate]

I'm looking for some help with a school project which needs a shell script to create 10 accounts (5 teaches and 5 students into different groups) along with respected passwords. I'm a true ubuntu noob ...
0
votes
0answers
27 views

script to move files from downloads to other folder (every time a file goes to the download folder)

My goal is to make an script which prompts up a "save as" windows every time a file falls on the download folder, and allows me to move that file to a selected folder.
3
votes
3answers
82 views

How do I capture a screenshot of a window, and all the windows on top of it?

I'm using screenshots as regression tests for GUI software. Before deploying each new version, a series of automatic tasks is run against the old and the new version, screenshots are generated after ...
-1
votes
2answers
25 views

“syntax error unexpected token fi” when trying to run bash script

I tried to run a script, but I get this error. What does it mean and how can I fix it? # Make the mesh using blockMesh (serial) and decompose it. if [ $runNumber -eq 1 ] cp ...
1
vote
1answer
32 views

How can I make a script autostart after I log into my computer on Ubuntu Mate 15.10?

I'd like to automatically disable the touchpad on my Thinkpad X301 after the system boots up. I can successfully run the script manually, but when I try to execute it by any autostart method, it just ...
0
votes
1answer
23 views

mariadb-server syntax error

I am writing a bash script and having trouble with $PASSWORD. Can anyone please tell me the correct way to write sql lines in bash script? QUERY="GRANT ALL PRIVILEGES ON db.* TO 'user'@'localhost' ...
-1
votes
3answers
99 views

Print different output in the same csv file

I'm writing a script to analyse some data. I have several subset of files, and I would like to count the line from these files and write the result into a csv file. I'll try to do an example. I have ...
0
votes
0answers
8 views

How do I find which serial port my Arduino is connected to with a shell script?

I'm writing a little script right now which sends some data to the Arduino through a bash shell script. The command that sends the data looks like this: alias led_green="echo -e -n '\x10' > ...
1
vote
2answers
65 views

How to check if script was executed via command line or double-clicked?

How can I determine if a script was invoked from a command line or via double-click in file manager (Nautilis)? If the former, I still have a command prompt when the script finishes, but if it was ...
1
vote
2answers
89 views

How to run a script from terminal [duplicate]

Hi I would like to run a script from the terminal, is there anyway to do that? For example : if I have a python script I would normally run it with this command : python script.py How can I run ...
0
votes
0answers
24 views

How to install a python script as an application

I have been trying to create a deb package for my python script following these steps. My myscript.py contains a simple frame. #!/usr/bin/env python import wx app = wx.App(False) frame = ...
1
vote
1answer
30 views

Does the 'at' command require a full path to the script's name?

I'm running Ubuntu 14.04 LTS. Sometimes I use the at command to run a Bash script one time like this: at -f goscript 8:00pm (Execs need me to run a report at a time not in crontab.) Is that the ...
7
votes
5answers
421 views

Bash - Check directory for files against list of partial file names

I have a server which receives a file per client each day into a directory. The filenames are constructed as follows: uuid_datestring_other-data For example: ...
0
votes
2answers
43 views

How do I change a variable of a background function?

I have been working on a script for my father that manages several tasks through a script with many functions that chain together (organization purposes). This script relies entirely on zenity for all ...
0
votes
0answers
13 views

Upstart Ruby version issue

I am trying to get Upstart to fire up Sidekiq (https://github.com/mperham/sidekiq/wiki/Deploying-to-Ubuntu). I can manually start it but the same command fails in the Upstart script. I have piped ...
0
votes
1answer
29 views

Bash script not running [duplicate]

So I'm pretty new to ubuntu and I'm trying to make a simple bash script that all it does is running Rubymine so I don't have to write it down in the command line everytime and also so I can have it on ...
1
vote
0answers
22 views

Archlinux shell script error [closed]

Today I tried to write a .sh file myself. I gave it permisson by doing chmod +x /home/admin/app.sh But when I run it, my chromium closed itself shortly (<100s) and this showed up in the ...
0
votes
0answers
14 views

setpath in .sh script is not working [duplicate]

This is my .sh script. #!/bin/bash export PATH=$PATH:/home/srilm-1.7.1/bin When I am using this script file I could not add the environment variable path for temporary purpose(though the script is ...
0
votes
1answer
9 views

How to automatically reposition my-weather-indicator desktop widgets for external monitor

My-Weather-Indicator is probably the best weather widget for Ubuntu desktop. However, one needs to manually reposition desktop widgets (e.g. aligned top right) every time an external monitor is ...
1
vote
0answers
27 views

Thunderbird does not preserve profile's language packs enabled status

I need to access the same Thunderbird profile from both Windows and Ubuntu. On Windows 7, it's Thunderbird version 38 (I think?) whereas the Ubuntu version is 44 (from the thunderbird-next PPA). ...
-1
votes
0answers
22 views

directory creation and ownership [closed]

I have certain directories like backup/data/cm/au and backup/data/cm/Di .Ineed to create the directory path from cm/au and cm/Di in /Tmp.with the same ownership as that of the Orginal directories.I ...
0
votes
0answers
17 views

Bash script: How to concatenate input parameters with strings? [duplicate]

I want to define an alias bak_log which uses an input parameter to backup all files starting with such string I can't find the way to concatenate the input parameter with other strings in order to ...
2
votes
1answer
94 views

How can I determine if a process has a window, and subsequently show, hide or close it?

Is it possible, either through a shell script or terminal command, assuming you have the PID, determine if it has a main window (form), and then get info about it (title) and show/hide/close it?
0
votes
2answers
84 views

xdotool, open and close Unity Dash on startup

on Ubuntu 14.04 the first Unity Dash search is much slower than the following searches. With xdotool I'm trying to open and then close the Unity Dash user interface on Ubuntu start-up. ...
1
vote
1answer
44 views

Sudo execute command in Pythonscript

I want to sudo a command from a pythonscript without hardcoding my password in it. The Pythonscript is part of a webservice on Apache2. Since it is part of a webservice, asking the user each time for ...
-5
votes
0answers
47 views

How do I write a shell script that creates a new user and adds it to a group based on input? [closed]

I need to write a script for creating a new user and adding it to a group. The script needs to ask for two information: the username; whether the user to be created is a student or a teacher. If ...
0
votes
0answers
37 views

Bash script not working with shortcuts

My bash script is working flawless when i call from terminal. However, when i create shortcut to it acts weird. #!/bin/bash url="" function uploadImage { url="$(curl -s -F "file=@$1" ...
0
votes
0answers
13 views

PHP in command line failed : ERROR: memdup failed

After an upgrade to 14.04 LTS, I discovered I have some trouble with PHP. It is impossible to execute maintenance script by command line: [root@xubuntu log]# php ERROR: memdup failed I get ...
1
vote
0answers
20 views

script to open terminal with multiple tabs and different directories

I find myself opening the same set of terminals every time I startup. I have 3 tabs in a certain directory, all with python venv's activated, and then one extra tab for ssh'ing if I need to. It ...
4
votes
1answer
102 views

Moving files with bash scripts

I have a bash script that watches a folder, if something is added to the folder, the script will move all contents withing the monitored folder to the defined destination. I have a few of these ...
0
votes
1answer
22 views

How to automate Dislocker process?

I have a bitlocker encrypted external hard disk which I use frequently on my Ubuntu 14.04 laptop. Everytime I connect my hard disk I have to enter the following four commands: sudo dislocker -r -V ...
3
votes
1answer
51 views

systemd service run on wireless network connect

I have a server that tries to connect to a mobile AP which is only sometimes available. This AP is a camera with images that need to be downloaded so the very second the server connects to this ...
0
votes
2answers
34 views

Add android-studio/bin/ to PATH environmental variable

Recently I installed Android Studio. Now I want to add android-studio/bin/ persistently to PATH environmental variable as Session-wide environment variables and not as System-wide environment ...
0
votes
0answers
14 views

How can I run a sudo command without entering a password? [duplicate]

I created a script that I wanted the system (Ubuntu 15.04) to run immediately after I log in, so I add the scripts to the "Startup Applications preference". However, the the script has some command ...
0
votes
1answer
39 views

How to set hdparm in boot? 14.04+

I want to disable the Advanced power management of the hard disk in Ubuntu 14.04. The hdparm command is working: costales@desktop:~$ sudo hdparm -I /dev/sdb | grep -i "Advanced power management ...
2
votes
1answer
27 views

Shell script needs to be run twice to work as expected

I have the following shell script: #!/bin/sh # 1. Kill the process along with the screen /usr/bin/pkill -f reportPrintingServer.jar # 2. Start the printing server again. /usr/bin/screen -S proRps ...
0
votes
0answers
13 views

Sudo, nohup and spewing detached processes

I have a jar file that I need to routinely kick start from the terminal, and needs to be run as root. I'd also like to leave that terminal open for use, so I'm using this bash script: $ cat ...
2
votes
1answer
32 views

Why to use bash in executing script? [duplicate]

In a former question, I was suggested to execute: sudo bash start-dfs.sh why not sudo start-dfs.sh ? I mean, what difference does bash makes?
14
votes
4answers
300 views

How can I limit or restrict access to an application?

My son received a new laptop this past christmas, primarily for usage at his new school... And now that he has his own laptop, he's stoked to have Steam installed. But the wife wants me to remove ...
1
vote
2answers
31 views

Running a Perl script as cronjob is not working while manual starting does the job

I have 3 cronjob entries (crontab -l) the first entry is a Perl script what creates a LVM backup of a virtual machine and the other two are just sh files performing mysqldump. Well however, I edited ...
0
votes
1answer
20 views

How can I scan all connected USB drives for a file?

I have an install of Ubuntu and I would like to run a script (bash, perl, python, whatever) that will scan all connected USB drives and report if it finds a text file. Could anyone guide me on how to ...
1
vote
0answers
9 views

Nautilus scripts not showing up (although on the right folder and executable)

I just installed ubuntu 14.04 and I'm setting everything up. I wanted to add a couple of scripts to the right click menu. Putted them on ~/.local/share/nautilus/scripts . Made them executable. ...
0
votes
0answers
14 views

installing GTsuite7.5

I freshly installed Ubuntu 15.10 on a virtual machine. When I launch my script, it returns that error below. I've tried to install the compat-libstdc and to create a link to the library which is ...
1
vote
0answers
15 views

App/Script consumes too much memory. Ubuntu may be killing it. How do I verify/check this assumption?

Hosted on Digital Ocean Ubuntu 14.04 1GB RAM, 30GB HDD I am running a python script that is reading a 200MB+ file line by line. Each line is parsed into a JSON object and then appended to an ...
0
votes
1answer
22 views

How to run multiple scripts each of which runs forever through one script?

Suppose I have the following two scripts: #!/bin/sh while true do #Do something sleep 1m done and #!/bin/sh while true do #Do something else sleep 1m done called First.sh and ...