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)

3
votes
1answer
370 views

How do I delete all pop/rap music?

I have all the music stored in ~/Music and I want to delete all pop music (or it could be a different genre). I was thinking to look the song metadata to check and see if a song is pop, and then ...
1
vote
0answers
44 views

how to encode a shell script so others can run it but they can not read it

I want to encode a script, so others can run that script to get relevant result but when they run command cat it should throw output in encoded format.
1
vote
2answers
175 views

How to run a shell script with a file argument located in the same directory at the script? [duplicate]

I would like to run a command with an argument placed in the same directory as the shell script, from a shell script. example: my_installer.sh: #!/bin/sh sudo dpkg -i --someflags=abcd blah.deb ...
2
votes
1answer
87 views

Rename all files in subdirecories

I am having a problem writing a script for mass renaming of files in subdirectories. I have a folder with multiple subfolders, and those subfolders have multiple files that I need to rename. This is ...
1
vote
2answers
152 views

How to enable tab autocomplete for scripts located in ~/bin?

If I put an executable in ~/bin I can just type the first few letters of the filename and then hit tab to let the shell finish the rest of the name. While this works with executable programs, it ...
0
votes
1answer
41 views

Smartctl script to write zeros

So i have an old hdd that was badsectors and i wrong the following script to write zeros in badsectors that smartctl finds. The question is will this help the read/write errors or it is futile? the ...
0
votes
1answer
102 views

Sharing variables between shell scripts [duplicate]

I have a shell script (let's call it parent.sh) which calls another shell script (child.sh), passing it an argument. The child script does some work and sets a value in a variable called create_sql. ...
1
vote
2answers
72 views

How can I run a bash script without affecting the file system?

I am trying to create some soft of a sandbox for linux systems (ubuntu). My main goal is to find out which files are executed by a bash script of my choice, without actually letting it run them. I ...
1
vote
2answers
387 views

Shell script file (.sh) does not run, and throws an error

I am new to linux, and I have a shell script (.sh) file I on my Desktop that I want to run. These are the steps that I did: This is the content of the test.sh file on my Desktop: #!bin/bash ...
2
votes
1answer
204 views

Cant read variable from user input in bash

I try to run script of my friend and I get this error when try to input some variable: : bad variable nameead: reload : not foundsh: 10: bin/reload.sh: bin/reload.sh: 11: bin/reload.sh: Syntax ...
3
votes
1answer
206 views

Udev not running scripts

I'm trying to make udev disable/enable my touchpad when I connect/disconnect my external mouse. I don't know what is wrong. When I call udevadm --test it seems to be calling my script, but when I ...
2
votes
3answers
185 views

Find & Delete duplicated files on multiple harddisks at once

I have 4 hard disks and want to find out which files on this four harddisks (including sub directories) are duplicates. It should be checked not only within a harddisk but against all the others as ...
0
votes
1answer
72 views

Need audio player for bash script

I'm working on a small audiovisual project, and I'm writing an auxiliary bash script to control some stuff. However, I need to play a generated audio file for a few seconds before stopping it, the ...
3
votes
1answer
76 views

Write a script to automate installing applications on freshly installed Ubuntu

Do not ask me why, but I often found myself installing a Linux distribution (e.g. Ubuntu) over and over again in a year time. For myself or others. I often found myself installing the same ...
0
votes
1answer
79 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
473 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
62 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
70 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
60 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
59 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
79 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
35 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
24 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
292 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
32 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
72 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
61 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
382 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
44 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
19 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
479 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
626 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
27 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
96 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
112 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
114 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
120 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
166 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
293 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
158 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
232 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
85 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
819 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
24 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
183 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
356 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
418 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 ...