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

0
votes
1answer
96 views

Make all new .sh file executable

One of my script is making new .sh files in /tmp/ folder how can I setup that all new files in /tmp/ folder will get chmod -x automaticaly because my script is failing when trying to run scripts in ...
5
votes
4answers
546 views

How do I make an entire directory executable?

I have an entire folder dedicated to python scripts. I'm tired of doing chmod on every new python script that I write. Is there a way to make every file inside my folder executable if it is a python ...
0
votes
1answer
80 views

start: Unknown job: tester while using upstart feature of ubuntu [closed]

I have a jar file which I am running like this in my Ubuntu 10.10 and then it starts my exhibitor server in the background - nohup java -jar ...
0
votes
1answer
84 views

Cannot run script at start-up because of dependecy

I want to make some scripts running at start-up, but one of them.. I read a lot of posts and tried lots of ways but still cannot make it. Let me explain what I want. I have a ubuntu 12.04. I need to ...
0
votes
1answer
62 views

What am I doing wrong with the shell script? Noob [duplicate]

I created a new document, opened it with gedit and the script is very simple and it works in terminal, basically something like this: #!/bin/sh sudo blah blah blah But when I save it on the ...
0
votes
0answers
64 views

How do I fix this bash script to auto-fix locked eth cards?

One of our servers has an eth1 interface which seems to randomly lock up--but which works again with no issues if this command is issued in the console: ifdown eth1 ; ifup eth1 I wrote a simple ...
0
votes
1answer
40 views

invoke a script on fail of a bash script

I want to run a script that create and host a website with apache server. if anything went wrong I have to rollback all the changes I made, like delete the created folder etc. I know set -e exits ...
1
vote
0answers
102 views

pdsh works well standalone, but doesn't work in script

I am trying to install hadoop via script on my small cluster [introduced in the book: Apache Hadoop Yarn]. I have set up ssh connect without password, and pdsh&pdcp are all fine if I use it alone. ...
1
vote
0answers
38 views

Upstart - unable to read /etc/shadow unless sudo

In the following script in Upstart, I'm unable to read /etc/shadow in pre-script phase, unless I use $(echo mypass | sudo -S cat /etc/shadow | grep myusername) The script works fine if I provide my ...
0
votes
0answers
27 views

failed to execute '/bin/eject'

Recently we failed in searching campaign for a Modem Manager for my ZTE USB modem in Ubuntu 14.04 and since then, I am getting, in my Ubuntu starting messages (probably boot scripts), a bunch of ...
2
votes
3answers
305 views

Rename multiple files whose names include '*'

I have a set of files whose names contain the character *. For Example, a file name could be ***abcdef. I want to change this file name to 3_abcdef, replacing the * with the number of * that were ...
-1
votes
2answers
57 views

I want to create a small programm in linux

I want to create a script in linux that will create random numbers from 0 to 30.000 and save them in a text file. I want all the numbers to be in one line. I also want the numbers be through 1 to ...
0
votes
0answers
35 views

multicd.sh script problem with ubuntu 14.04.1

I wanted to create multi-boot DVD with ubuntu-14.04.1-desktop-amd64 and ubuntu-14.04.1-desktop-i386. I use multicd.sh script (multicd.tuxfamily.org) in linux OpenSuse and create a ISO with both Ubuntu ...
1
vote
2answers
76 views

How to create a script that will connect to a specific network

Using the integrated Network Manager, I created a new VPN Connection, called 'My VPN'. When I click it, it connects - great. Now I need to automate it a bit. Is it possible to write a script which ...
0
votes
0answers
62 views

Script problem at boot ubuntu

I have an application in C++ which show a ipcamera video when I send it a value by ethernet. I want that the application start at boot in automatic way. This is my script: #!/bin/sh ...
2
votes
1answer
557 views

Daemon not running on boot

On an Ubuntu (14.04) VM, I have a simple node server that I want to run on startup. The following script works when invoked just as ./noderoot start, but isn't running on startup. The script is ...
1
vote
0answers
46 views

How to autorun a script as root just after the user's encrypted home directory has become mounted on headless server?

There is a problem with ecryptfs that it heavily limits the maximal filename length. To walkaround it I link most home subfolders to the external encrypted partition. The partition gets mounted just ...
0
votes
0answers
22 views

Rename and Resize Photos Script

I want to have an automated script run every day, it renames my photos to creation date and location, something like this 2014-09-Paris-001.jpg 2014-09-Paris-002.jpg etcetera and then resize a copy ...
1
vote
4answers
703 views

How Can I Run an Shell Script With .desktop Config File?

I am trying to run a shell script with a .desktop file but it doesn't seem to work, producing an error of There was an error launching the application at each attempt. I have the sh and .desktop files ...
0
votes
1answer
815 views

Run Script ubuntu 14.04 at boot

I am pretty new at scripting in Ubuntu. I have an application in C++ which uses OpenCV for Ipcamera video processing, I am working in Ubuntu 14.04. I am going to try to explain what I did: First I ...
0
votes
1answer
29 views

executing shell scripts

My help file states the following: When a script is executed from a local folder, all selected files will be pasted to the script as parameters. To execute a script on a file: Navigate to the desired ...
0
votes
2answers
108 views

How Can I Remove All Characters After a Certain Character Appears Twice Using Bash Scripting?

I have multiple files in a directory over 200 which I would like to rename by removing all other characters including the character and the rest after it appears twice. Example: One of the files in ...
0
votes
1answer
138 views

How to automatically mute on headphones disconnect? Or how to tap bash script to system event listener?

My life would be easier if Ubuntu was muting the sound each time I disconnect the headphones, since every time surrounding is different (example day / night), but the same output volume. I may ...
0
votes
2answers
124 views

How to replace a string of text with input from another file

I am working on a script to configure a server. Basically the script installs several services and copies configuration files in to place. I would like to replace the username in one of the ...
0
votes
2answers
122 views

How to write a script which automatically presses `Fn + F3` button on my keyboard

I am struggling with screen brightness reset issues . It resets to 100% on every reboot. I have tried searching for solutions but none of them worked[including xbacklight ]. Since I can change ...
0
votes
1answer
217 views

Help decoding Base64 using base64 -d

**** This post links to Windows-Based malware executables!!! DO NOT EXECUTE DECODED SAMPLE **** I hope I can post this here without having it pulled down. I have 2 seemingly identical base64 ...
7
votes
2answers
310 views

How can I pass command line arguments to a script through Dash? (14.04)

I recently asked this question about adding a shell script to Dash: In 14.04 how do I run a bash script I wrote without opening a terminal? It worked perfectly. Follow-up question: How can I ...
1
vote
2answers
194 views

script convert files using dos2unix [closed]

I want to create a script to monitorize my local folder and every time it receives a file starting with frm*, to convert it using dos2unix. This script is always running and keeps converting the same ...
1
vote
2answers
327 views

execute shell script from desktop in xfce

At first I just made a link to the .sh file on my desktop which failed to execute by double click. Then I've read about .desktop files and made one still to no avail. The program I want to run is a ...
1
vote
1answer
100 views

how to make scripts which will run on installation of apt package

I have created a bash script which will store some data into a mysql database. Then I have created deb file with that script and made it available for installation by creating local apt repository. ...
1
vote
0answers
27 views

Reading Cronjob Output [duplicate]

I have a task setup to run on my cronjob where I need to read the output. What I need from the output is the starting character (let's say A) and the ending character (let's say Z). A helps me ...
1
vote
2answers
1k views

Cannot run bash script from crontab when it works from command line bash

I have a strange problem of being to able to run a bash script from commandline but not from the crontab entry for root. I am running Ubuntu 12.04. * * * * 1-5 root ...
0
votes
0answers
26 views

How to: autocreation of system performance / health log?

I want my system to create file with a history entries filled by: exact time CPU, GPU, HDD temperatures network total up/down bytes RAM and swap % usage Less important: CPU, GPU, HDD loads ...
0
votes
1answer
226 views

Add custom script to PATH

I know there are quite some answers about that, but still could not make my way around it. I read all this and tried to follow the example under System-wide environment variables (for my case of ...
3
votes
1answer
479 views

In 14.04 how do I run a bash script I wrote without opening a terminal?

I use terminal a lot. I wrote a script and have it in ~/blah/script.sh now. How can I run the script from Unity (Dash?)? A long time ago I would have used ALT-F2 and typed my command, but that ...
2
votes
3answers
450 views

Batch rename — multiple image types

I have a large number of images that I copied from a failing external hard drive. All of the images are fine and have no corruption, but oddly a large number of them are now missing extensions. The ...
0
votes
1answer
59 views

Where is the laptop brightness script located?

Online I found the command: echo 1 > /sys/class/backlight/acpi_video0/brightness to set my screen brightness to the lowest possible value, currently I am grepping my entire disk for that path, ...
0
votes
1answer
85 views

Weechat error: unkown command “script” (type /help for help)

While trying to set an autoloading python script in ubuntu, I received the error listed in the title. A google search returned no similar issues and when I type /help scriptthe output returns: No ...
1
vote
2answers
106 views

gibberish command not found on bash terminal startup

I have run across an issue that I just cannot seem to figure out. When I start my terminal in ubuntu (14.04) I get the message sdfsdfsdi: command not found As you can see it just looks like ...
2
votes
0answers
255 views

Port redirection for a specific (dynamic) IP using iptables script

What I want: Incoming TCP and UDP connections on port 900 from the resolving IP address of myip.dyndns.org (dynamic IP) should redirect to port 5050 on the local machine. All other IP addresses ...
3
votes
2answers
945 views

Script doesn't work when it is run using '#!/bin/sh'

I have a script that use shebang : #!/bin/sh, but when I run it in my Ubuntu 14.04 terminal, it doesn't work and it says that some lines has unexpected operator. My friend in another computer could ...
1
vote
2answers
168 views

How to run commands from a bash file the way they run from terminal?

Sorry for my probably very naive question. What I mean is: how to create an executable script/bash file that would run more complex commands, commands which must normally be put in a terminal? ...
0
votes
1answer
29 views

Where does the output of a script that was run at startup go? [duplicate]

I have a script which is run at startup from rc.local, I don't redirect the output anywhere. When I first wrote it, I ran it in a shell, it worked as I expected and continually poured characters out ...
0
votes
1answer
89 views

unable to execute .sh scripts - only on one pc

This is an unusual problem for me - what would cause one pc to suddenly be unable to execute an install.sh script, yet two other pcs with the same OS have no problem doing so? I get various errors ...
0
votes
2answers
397 views

Starting a script in a Desktop icon

I have the following .desktop file on my Desktop: [Desktop Entry] Encoding=UTF-8 Name=Robomongo Comment=Launch Robomongo Exec=/usr/local/robomongo-0.8.4-i386/bin/robomongo.sh ...
1
vote
1answer
127 views

Commands not executing in shell script run by udev

I'm having trouble using udev to run a shell script that backs up my hard drives to an external drive whenever the external drive is connected via USB. Everything works except the actual call to ...
1
vote
2answers
161 views

“mv” versus “cp” in a bash script [closed]

I am attempting to make a script that will be able to load up some settings and files to a board. Basically I will plus a flash drive into the board click on the script. The script will then ...
0
votes
1answer
87 views

Ubuntu bash if lessthan else condition returning error [: -lt: argument expected

I am doing the following script to know if profit or loss from entered selling price and cost price as; echo enter selling price read sprice echo enter costprice read cprice if [ $sprice -lt $cp ] ...
0
votes
1answer
46 views

Script needed to copy data to a mounted storage device

I have a 1 TB HDD. And have problems copying data to it whenever i update it on my Ubuntu Machine.Can anybody suggest me how to make a script for Ubuntu such that whenever i mount it copy the newly ...
1
vote
3answers
126 views

Sort videos by bitrate

I have a folder with some 300 videos. I want to sort these by their video bitrate. I use a command 'mediainfo' to obtain the bitrate info of a file . Is it possible to write a script (possibly in ...