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
0answers
14 views

Reliance Auto Login Help

i want to run this script https://github.com/pteek/reliance-auto-login-script but i get this error in lubuntu " Traceback (most recent call last): File "./reliance-login.py", line 27, in ...
0
votes
1answer
29 views

piping in real time

This is more a conceptual thing than a current problem. Would it be possible to do this: tail -f <file> | grep "string" | sed 's/stuff//g' >> output.txt The problem I'm thinking is that ...
3
votes
1answer
164 views

How can I automatically copy the content of a usb (flash) drive to another directory?

I want to program my Ubuntu in such a way that it automatically copies the content of USB flash drive to a defined folder in my home directory. I would like this to be done automatically when any ...
0
votes
0answers
86 views

Bash script is not working. Could somebody help me?

E: Hi, i could use some help. I am sorry that some parts of the bash are in german. There are sure some mistakes in there but i can not find them i tried severel hours right now. I would be happy if ...
1
vote
1answer
58 views

Start script on boot up?

I want to run a script when the system starts. The script is: #!/bin/bash gnome-terminal --tab -t "MyPC" -e "sh -c 'nohup firefox & nohup gedit & bash'" --tab -t "MYPC2" -e "sh -c 'ls -al;ls; ...
0
votes
0answers
31 views

ssh connection problem

Hi everyone i am developing a robotic app, i want to run my launch files under a ssh connection with this script but when i run script it wants may password, i write it but nothing happens although i ...
0
votes
2answers
53 views

Script that generates a file with random content

Can anyone suggest a way to write a script that creates a text file filled with random data of exactly 12 MB ? Say I'm interested in creating within the script the file /home/student/john.bin that ...
0
votes
1answer
76 views

Using script to download a file

I'm interested in creating a script that makes no use of wget which downloads a file from a specified link . The download should be saved as world.o in the folder /tmp. Can anybody walk me through ...
0
votes
0answers
48 views

Crontab wont run this script!

I am trying to run this script as a cron job to enable a weekly back up of my mediawiki site. Running on Ubuntu server 14.04. It simply will not run. The scipt is running from the root folder of the ...
2
votes
3answers
548 views

Displaying IP address on eth0 interface

How can I display the IP address shown on eth0 using a script ?
0
votes
1answer
89 views

How to delete backup files using a bash script? [duplicate]

I want to automatically delete the backup files(those ending with ~) from everywhere on my computer. I tried to write a simple script usinglocate command, but I'm stuck at deleting file having space ...
0
votes
1answer
16 views

Problems appending lines from a script

I'm writing a script and here's how i'm inputting into the CurrentOutput.csv file. echo "$col1,$col2" >> CurrentOutput.csv Input.txt 1.2.3.4 2.3.4.5 3.4.5.6 CurrentOutput.csv 1.2.3.4 ...
0
votes
1answer
67 views

Linux alternative to Windows Script Host

I've just switched from Windows to Ubuntu. Really enjoying it right now and haven't encountered any issues whatsoever. The only thing is that I'm really gonna miss a lot of useful things that Windows ...
0
votes
0answers
30 views

How can i change a script to a system command? [duplicate]

If I have a script, let's say shebang.sh. To execute, I have to do './home/user/Desktop/shebang.sh ' How can I make it 'shebang' From any directory?
2
votes
3answers
224 views

Why do I have to change into my private bin folder to execute an .sh script?

I have a private bin folder in my home directory. It's is also in my path. If I try to run a script from anywhere else in my system but within that folder, I get sh: 0: Can't open [name of ...
0
votes
1answer
23 views

adduser causes strange messages when called from preinst script

I have a .deb package in which I have a preinst script that executes the adduser program in case a certain user is not already present on the system. $(id -u {username} > /dev/null 2>&1) if ...
0
votes
1answer
42 views

Script to remove JPG's with particular vendor tag

Somebody put their memory card into my smartphone, and suddenly (with auto-upload enabled) I have a folder full of photo's that are not mine on my Ubuntu machine. How can I delete JPG files that have ...
0
votes
0answers
29 views

start krusader editor from a command line bor bash

I am really happy with Krusader's internal editor and I would like to use it for editing files via bash scripts. So instead of: leafpad ubuntu.txt I would like to run say something like that to ...
0
votes
0answers
141 views

Remove “android-tools” package (adb and fastboot) and sdk from 64-bit 12.04

I installed Android SDK to root my android phone, using a script obtained thus: wget http://linuxundich.de/static/android_sdk_installer.sh chmod +x android_sdk_installer.sh sudo ...
1
vote
3answers
168 views

Bash command to convert IP addresses into their “reverse” form?

When I run nslookup on an IP (These are all examples) nslookup 192.168.1.123 Current output: 411.311.211.111 Desired output: 111.211.311.411 I have a script that works just seeing if there's ...
2
votes
0answers
67 views

How to have a video player resume from where I last left off?

I'd like to be able to launch a video player (VLC, SMPlayer) via Terminal, using some command like resume_media and then it will automatically find the most recently played media file (.mkv, mp4 etc.) ...
0
votes
1answer
47 views

unable to execute after loading second shell /bin/bash?

I went through a shell scripting tutorial explaining about global variables (export). I encountered a do-it-yourself example to illustrate the concept of global variables in shell scripting, and I ...
0
votes
1answer
14 views

I set a script to start at boot with kde startup and now if I log into my main account it locks after I click anything to delete it

I'm new to Linux and I was trying to set a script to adjust my mouse acceleration on startup but when I set the script path on kde startup I didn't adjust the text file to anything special I just left ...
0
votes
1answer
30 views

How to use script parametr(folder path) as a variable?

I want to write a script which can delete all 0 size files. I already have command to do this - find . -size 0 -type f -delete. The problem is that I want to use 1st script parametr as a path. I had ...
3
votes
1answer
108 views

Make a text file my automatically updated background?

I want to make a "to-do" list my wallpaper. I was hoping to be able to write a text file, save it, and have the background be updated each time I edit file. Is this possible?
0
votes
1answer
18 views

ACL - only grant access to reading, *not* to execution

I have a directory called /test it there are two files: info.txt script.sh I want to grant read-only access to user john and did the following: setfacl -m u:john: r test/ With the above command ...
2
votes
1answer
132 views

Run script with arguments as sudo without being asked for password

I have two programs in Java that I'm calling from bash script: java program1 arg ... arg sudo java program2 arg ... arg I want to run program2 as sudo without being asked for password. I'm aware of ...
0
votes
1answer
95 views

Launch url to start a script like a cronjob?

I have a website on mutualised hosting (server A). I need to run every minutes a script, I just need to go to http//www.mysiteserverA.com/run.php I searsch a solution automaticly run this script every ...
1
vote
1answer
34 views

Is there a log of the output of “bash install.sh [ ]” available for Ubuntu server?

Following the advice of someone on this site I attempted to update a wireless device driver with: bash install.sh [] which I ran while in sudo. The update didn't work and I'm wondering if some ...
0
votes
2answers
125 views

Find and execute multiple scripts in parallel

G'day, I have tried to solve this problem all morning but have not had success. I would like to search for certain scripts in a particular folder and execute them all in parallel. The scripts have ...
1
vote
1answer
27 views

variable is not found in a bash script

I have written the following code to create a directory where the directory name will look like "nowt_hour_nimute_second". But the code is failing in Bash Shell. #THIS CODE WILL CREATE A DIRECTORY ...
26
votes
7answers
3k views

Delete all files apart from pdf files in a directory

I have a directory that contains the following: x.pdf y.zip z.mp3 a.pdf I want to delete all files apart from x.pdf and a.pdf. How do I do this from the terminal? There are no subdirectories so no ...
2
votes
0answers
102 views

How do I force nmcli to reconnect to different uuid?

I have a bash script that checks my network environment and mounts shares accordingly. If I'm at work and have a hard-wire connection to the LAN, then I'd like to activate a hotspot connection for ...
3
votes
1answer
308 views

Stop/kill running script if $USER != “root”

I'm working on a scripts that needs to be executed as root, else it should stop everything. #!/bin/bash validationRoot() { if [ $USER != 'root' ] then echo "You're not root! ...
0
votes
1answer
37 views

Can somone help me make this script more readable?

SRC="/src" export DEST="/dest" find "${SRC}" -iname '*' -type f -exec bash -c 'EXT="${0##*.}"; EXT=${EXT,,}; if [[ "${EXT}" == *"/"* ]]; then EXT="no_extension"; fi; mkdir -p "${DEST}/${EXT}"; rsync ...
0
votes
0answers
36 views

security updates

I am using ubuntu14 in aws amazon to run my project on browser. But there is a major problem that I am facing. Every time when I login to the server using putty, I get security updates & upgrades ...
0
votes
1answer
29 views

How do you create a Bash Script for replacing text in a document, utilizing regular expressions? [closed]

Identical to this question: Find and replace text within a file using commands However I want an answer that utilizes regular expressions specifically. So in short: Using commandline; what command ...
2
votes
1answer
110 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
35 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 ...
-2
votes
1answer
35 views

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

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)
1
vote
1answer
526 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
107 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
39 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
210 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
246 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
57 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 ...
30
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
260 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
377 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
48 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.