A shell script is a script written for the shell, or command line interpreter, of an operating system.

learn more… | top users | synonyms (1)

0
votes
0answers
14 views

Cuttlefish #!/bin/bash not working 0.o

I was running Cuttlefish on Ubuntu 14.04 with 2 scripts to dim and un-dim my screen when AC power changes to battery and reversed. I reinstalled today and can't make the script dimming or un-dimming ...
2
votes
0answers
17 views

Find not removing files in folders through bash script

I'm very new in bash scripting and I'm really stuck on the find method from Ubuntu. I want to search in the folder /opt/ for all folders to see if they are older than a specific date. If they are ...
0
votes
0answers
19 views

Bash question with system processes? Stopping and renicing “Java” processes

I play minecraft on linux, and I would like to make a Bash script that does two things. First, I would like it to close the minecraft launcher's process. Secondly, I would like it to renice the ...
-1
votes
1answer
27 views

Is there a script that moves all files in the folder automatic [on hold]

Is there a script that moves all files that get into the folder get moved to another folder My gameserver put logs into a folder and i want them to go to the /var/www (online)
0
votes
0answers
20 views

UMS.sh (run as service) on Ubuntu 14.04 won't read configuration file

I'm trying to get my ubuntu 14.04 to run universal media server so I can stream movies to my ps3 (lowest firmware 4.55 unfortunately - unjailbreakable). After much research on the net I was able to ...
2
votes
1answer
44 views

Shell script to move all images excluding ones with size in name using find?

I have a server backup of a WordPress site that has about 1000 images in the uploads directory. When an image was uploaded through WordPress it would create multiple sizes of the image such as: ...
0
votes
0answers
15 views

Run cron job to execute a script when a particular file is updated

I would like to automate a process which requires running a script to generate some files. To do this I thought that adding a cron job to run this script would be great. But I want cron to run the ...
2
votes
1answer
45 views

Shell script for list of users by groups

I want to write a shell script that generates a list of users. for each user display the username and ID and all groups the user is a member of it means like GROUPS command but for all users and with ...
0
votes
1answer
11 views

Running script to repair bricked Android [duplicate]

I have unfortunately bricked my device, one of those issues that most if not all of us who like to root/ROM our devices have had to deal with. I need to run a script that will fix the issue to where ...
0
votes
2answers
33 views

Media Scanner Script

I am a beginner with Bash scripting. I have recently been working on a script to harden Ubuntu computers for a school project. Everything is going well, except that the students are not allowed to ...
27
votes
1answer
1k views

How can I make cowsay say something every time I close the terminal?

I want cowsay to print something like "have a nice day" when I close the terminal. I know I have to have some kind of script, but I'm not even sure how to write a script or how to use it once it's ...
2
votes
2answers
207 views

Run a standard command in bash script

I am writing a bash script to automate several actions: #!/bin/bash echo "Hello, World" NAME="${1}" PATH="${2}" echo $NAME echo $PATH eval "ls" I am going to call ls, ffmpeg and a lot of ...
3
votes
1answer
337 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
31 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
49 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
56 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
127 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
12 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
27 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
46 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
49 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
101 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 ...
2
votes
1answer
76 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
80 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
30 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
28 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
38 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 ...
4
votes
4answers
374 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
24 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
24 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
53 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
38 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
0answers
37 views

Mount and unmount network shares using bash with different credentials for each user on login/logout?

I've had a look through a couple of similar questions but I'm not satisfied that there is enough information for me to work this out on my own :( Ok, I have a NAS which has it's own users, and each ...
0
votes
1answer
33 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
20 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
17 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
16 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
252 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
45 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
10 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
54 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
50 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
55 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
21 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
8 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
80 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
72 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
13 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
66 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
38 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 ...