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

0
votes
0answers
59 views

How does SFTP work? Please help someone

We run a system that automatically sends a swift message at the end of a process. But this messages are sent using FTP. We feel the FTP process is too prone to MITMA and wish to change the sending ...
1
vote
1answer
37 views

How to run a function for every specific received packet?

I am doing an experiment for my master thesis. I want to run a function (e.g. multiply two numbers) when a specific packet is received (e.g. a packet with destination TCP port 6666) and then forward ...
0
votes
0answers
28 views

PHP Scripts doesn't executed

I installed LAMP server successfully.But,I didn't have permission to save my php scripts in var/www/html folder.Then I ask it from this forum and fix it. Now what happen is I can save my phps scripts ...
0
votes
2answers
32 views

Are log files written to when a buffer fills or in 'realtime'?

I have a script running which pipes its output through another script; that wrapper script adds a timestamp to each line of the log. However the data is being written to the log file in chunks of ...
0
votes
0answers
42 views

Run script from sublime-text

I have a script that writes public keys on servers that I use. In previous versions of Ubuntu 16.04 I could use it normally. I do not know if it is related to Sublime Text or Ubuntu itself. But today ...
-1
votes
1answer
35 views

Rename file under sub-directory in bash [duplicate]

I would like to know how to change the name of a txt file inside a directory. I know that I can mv test123 test456, but that only changes the name in the current directory. What if I want to change ...
1
vote
1answer
37 views

APK versionName grep

Im trying to retrieve the VersionName of a bunch of apk files i have in different folders and store them in an array , but its not working ... I've tried pretty much everything but it only loops 1 ...
0
votes
0answers
65 views

Extract data from logfile from only the previous 24 hours, with bash in a shell script

Using the Ubuntu 14.04 trusty and transmission log for the log file. What is the best way to extract the last 24 hours of log entry's? I have attempted using sed awk grep I cannot seem to get the ...
2
votes
2answers
75 views

STDOUT and STDERR redirection for nc

I am trying to make a watchdog bash script which has to check if the port is open, based on the exit status, otherwise should start the daemon. Problem is I can't manage to avoid the script outputting ...
3
votes
3answers
282 views

How can I give a script its own icon in the Unity launcher?

With Ubuntu 16.04, if you create a launcher (desktop file in ~/.local/share/applications) with a custom icon for a terminal application (so with Terminal=true) then when you start it, it will spawn a ...
3
votes
0answers
47 views

Script on reboot

So, I programmed a simple script to alert on slack whenever the server is rebooted. What I did: In /etc/rc6.d/R99reboot-slack: (I tried with R01reboot-slack) #!/bin/sh /scr/msg.sh "Server restarting.....
3
votes
2answers
73 views

Changing the login shell

If I change my shell with chsh to a shell that I wrote myself, which scripts does it need to execute? I already tried changing to my own shell and surprisingly it worked without an error msg. Now does ...
5
votes
3answers
128 views

Update brightness level depending on the power source on 16.04 LTS

I recently migrated to 64 Bit 16.04 LTS from 32 Bit 14.04 LTS on my Toshiba L645 laptop. In 14.04 LTS system, I had a script that automatically updated the brightness level depending on the power ...
1
vote
1answer
42 views

Run my bash script on login and SEE terminal [duplicate]

i need your help :) I have some script that start on login (I set it on Application launcher preference) but i can't see terminal. One script it's easy and make light on on my CMstorm keyboard and set ...
0
votes
0answers
23 views

Creating A Drag and Drop Bash Script for wipe

WARNING: This question contains dangerous commands. Do not execute these commands on your own computer unless you wish to lose data. I have been using the command like program 'wipe' for ages with ...
0
votes
1answer
35 views

script in shell downloaded by won't execute

I downloaded this file: Renta2015_unix_1_30.sh changed the permission to executable but it won't execute. There seem to be a way to do it in terminal, but it requires the command cd and then the ...
1
vote
3answers
62 views

String Manipulation

var="<string> 1.11 </string>" I want to get rid of <string> and </string> How can I do it? For now i got this: var=${var:9:4} 1.11
0
votes
1answer
35 views

Problem when run script in boot

I created the following script: #!/bin/bash su administrador -c "/home/administrador/scripts/startup_tomcat_hsqldb.sh" I added in /etc/init.d . When I run the command: sudo update-rc.d start-...
0
votes
0answers
15 views

Jar file not coming out of loop in Apache ubuntu

I have set of shell scripts which run in Apache server from cgi-bin. The first script triggers the second, the second triggers the third, and so on. Except on a particular script, say the 10th script.....
3
votes
1answer
65 views

Why does launching my own script from a launcher only work once?

I created a shell script, let's say it's echo hi sleep 5 echo bye exit Then I created a .desktop -file to launch the shell script. Double-clicking it works perfectly fine: [Desktop Entry] Version=...
1
vote
2answers
64 views

Cron Job doesn't execute

I created a cron job as root with the command: crontab -e Then I added 0 4 24-31 * 4 /home/backupscript.sh after the last line. The output of crontab -e looks like this: # Edit this file to ...
1
vote
1answer
56 views

Creating a bash script [closed]

Alright so, just for a little heads up, I literally just learned what bash script was today. Anyways, I have this series of voice recognition programs wrote in python, and I wanted to make a voice ...
0
votes
1answer
41 views

uninstalling .sh files

I have been run this code sudo ./uninstall.sh in the the directory which I had been install netbeans 8.0.1 and the code runs and the uninstall window opens but it doesn,t uninstall anything.!! Is ...
0
votes
1answer
23 views

Problems understanding how set works

Can someone please help me understand the following code segment? set -- ${BACKUPDIR}/backup-???.tgz lastname=${!#} backupnr=${lastname##*backup-} backupnr=${backupnr%%.*} backupnr=${backupnr//\?/0} ...
0
votes
1answer
41 views

Running a do loop

I am attempting to build a loop to check for files in a folder then run a loop if files exist in the folder and keep running the loop until no more files are left, but I am running into the token ...
4
votes
1answer
116 views

How to open 'Magnet' style torrent links from Firefox in rtorrent?

I am using the commandline torrent client rtorrent under Xenial Xerus and I would like to: Find and click on a 'Magnet' style torrent link with Firefox Have the 'Magnet' link opened automically in ...
3
votes
0answers
34 views

How to run a program in its own, temporary, xdisplay (runx)?

For background I like to play some older games that really run better in super low resolutions and having the whole desktop switch to 320 x 400 is really not that great. I've gotten around this by ...
0
votes
0answers
32 views

how to exclude application/x-executable files in below command

need to add application/x-executable file types in below command. there is no extension for those of files. the only thing i know is the file type is application/x-executable --exclude={.*,*.cbp,*....
1
vote
4answers
60 views

what is the meaning of FOUND in grep FOUND

I came across this command sudo clamscan -v -r /folder/to/scan/ | grep FOUND >> /path/to/save/report/file.txt while studying clam ( an open source antivirus engine). I am unable to understand ...
3
votes
3answers
170 views

How can I automatically mute an application when not in focus?

When I'm playing some games like chivalry Medieval Warfare and I switch to another software like Firefox or Desktop the sound of the game still plays. So, How can I fix this problem ?
-1
votes
1answer
45 views

How to get the IP address from the nova list

From Openstack, i need output like hostname, status and ip address only but i am getting hostname, status and id=ipaddress nova list | grep Hostname1 | awk '{print $4,$6,$12}' Output : ...
3
votes
1answer
48 views

Execute script on every start, wakeup and activation!

I want to execute a script on every start up, wake up and activation. In the current setup the script is executed in: /etc/rc.local /lib/systemd/system-sleep It works so far, but if I reactivate my ...
0
votes
0answers
26 views

Hash script to audit filesystem from /bin,/sbin,/usr/bin,/usr/sbin/ [duplicate]

I trying to do a script to audit files from many directories with md5sum sha256sum and sha512sum. Here is what I have now: #! /bin/bash clear hashone=md5sum hashtwo=sha256sum hashthree=...
3
votes
1answer
217 views

Run scripts based on time of day

I'd like to run a script based on the time of day, specifically so I can make my computer (Kubuntu 16.04) switch themes at night and day automatically based on the time. How would I go about doing ...
1
vote
2answers
84 views

How do I run a python script whenever a file is created in a directory?

So, I'm trying to do this, somewhat, simple task, but I have not been successful yet. I'm hoping that changes now. The goal: Run /var/www/lager-scanner/filer/pluk_script.py whenever there is a new ...
0
votes
2answers
39 views

over-coming interactive command in a script [closed]

I'm trying to have a script to create containers on proxmox, & I want user to enter his password before proceeding to the creation of container, so I can push it to the main command. the command ...
1
vote
1answer
65 views

Can a script modify an environment variable of its calling shell? [duplicate]

I am setting my JAVA_HOME in my ~/.bashrc file. Now, I need to create a script that will change the JAVA_HOME just for the current terminal, so that I can start an app that needs java 5. I have ...
0
votes
0answers
88 views

USB Bluetooth doesn't reconnect after reboot

I have an Insignia USB bluetooth adapter and bluetooth mouse/keyboard. I can connect to them fine using bluman commands in terminal. However when I reboot, the devices loose connection immediately. ...
0
votes
1answer
44 views

Reloading .bashrc after setting variables — shell script

I have a simple script that sets up a CVS repository (and other things) for work. The script has a function which should set up the repository, but it does not properly reload .bashrc. The code is as ...
3
votes
0answers
44 views

How to trigger a script on entering/exiting a workspace?

This is regarding ubuntu 15.10. I have enabled workspaces, and would like unity launcher sidebar to show open application icon only if it was opened in the current workspace. To do so, I have already ...
3
votes
3answers
427 views

How to trim user input in bash script?

OK, here is a given user input : $ myscript.sh file-name.txt I would like to trim "file-name.txt" to retrive 'file' in bash script #!/bin/bash FILENAME=$1 # trim text after '-' from user input '...
0
votes
0answers
27 views

Script to delete smaller 'duplicate files' recursively with suffix

I've got an issue on my system where a image import process occasionally fails, causing some imported files to be truncated. Re-running the import process often works, but changes the imported file to ...
1
vote
0answers
14 views

DLNA Play-To on Script

Is there a way to push content to a DLNA capable TV via script on a loop. We have a situation where TVs in a public place keep getting turned off by people walking by. Would like to be able to push ...
1
vote
1answer
60 views

Changing desktop background in bash

I wanted to make a bash script that takes a random picture from a folder and sets it as the desktop background. I figgured out the algorithm (it's not hard) but i can't find a command that would ...
8
votes
1answer
257 views

Get word under cursor in X11

For some scripting, I need to get the word currently under the cursor. Can xdotool or a similar tool get it?
2
votes
2answers
92 views

Execution permission to all files created under a specific Directory by default [duplicate]

I would like yo know if there is any method to provide execution permission to all files created under a specific directory by default. i.e, If I create a file say foo.sh under a directory ...
0
votes
1answer
35 views

Script won't Start on Logon of Raspberry Pi 3 [closed]

I am wrote a Bash script that will be run on log-on for the Raspberry Pi running Kali Linux. The issue lies when the linux system starts up, I have to physically SSH into the terminal for the script ...
0
votes
0answers
60 views

sudoers, NOPASSWD, and a /home/user/bin/script not working explanation (with workaround)

Ubuntu 14.04.3 The Problem I have a directory with some custom scripts, one in particular called aptupdate. The permissions of the directory are: drwxrwxr-x 2 htpc htpc 4096 May 4 00:35 /home/...
1
vote
1answer
51 views

Limit to bash script execution time with interactivity?

I typically record my steps when deploying systems, and I often will duplicate the server during its initial testing. For example, if I get a little too far in the weeds while I'm testing, I simply ...
1
vote
1answer
34 views

History and aliases issue

I need help regarding shell script. How can I list all commands from history for which is already defined aliases?