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
2answers
16 views

spawn command not found on ubuntu 14.04

I'm using Ubuntu 14.04 and I want to block SSH login country wise using GeoIP ( From https://www.axllent.org/docs/view/ssh-geoip/), Please find output of command: $ spawn spawn: command not found ...
0
votes
0answers
22 views

Executable file - No such file or directory

First I made a shell script executable by typing chmod a+x try1.sh in the terminal. Then, when I double-click on try1.sh and select 'Run on terminal', the screen just shows 'No such file or ...
0
votes
0answers
15 views

Creating a script for modifying several users crontabs

OK, so I run a seed-box like local machine with Ubuntu 14.04LTS setup with multi-user rtorrent/rutorrent. I installed that through a script that also installed crontab entries for each user so ...
0
votes
2answers
15 views

Permission denied in rc.local

Here's the contents of my /etc/rc.local /etc/pm/power.d/99macbookair6 true echo 0 > /sys/module/hid_apple/parameters/iso_layout exit 0 running service rc.local start returns /etc/rc.local: ...
3
votes
1answer
17 views

How to use the update function in 'rhash'

I'm having trouble using 'rhash' to update an existing file containing md5 checksums on Ubuntu server 14.04. Here is my script: #!/bin/bash sudo rhash -r -u --md5 /checksum/these/files --output=/...
4
votes
4answers
194 views

Capturing only a section of a command output

If I were to type a certain command, it would give me a long output in the terminal. I only need a few characters of this output. How do I, in a bash script, save only certain characters from a ...
11
votes
1answer
520 views

Is it possible to set Ubuntu a way that it does not shutdown before a script is finished?

I use a script to do incremental backups of a btrfs partition from one disk to another. The script is started by cron.weekly at random time of a day. If I shut down the system while the script is ...
3
votes
3answers
158 views

python subprocess.call() not working as expected

I started down this rabbit hole as a means to familiarize myself with how one would go about creating a setup script in python. The choice of python was simply rooted in my familiarity with it while I ...
0
votes
0answers
13 views

Keep Ubuntu at the frontier with the latest stable releases

I would like to set up my own Ubuntu distribution such that it is always updated with the latest stable releases of every single package I have. Since stable Ubuntu point releases are always a bit ...
1
vote
2answers
51 views

How to split a file up into many smaller files and then reconstruct them? [duplicate]

I need to upload a file which is about a GB to an online server to get to a friend. Now there seems to be a problem with my internet connection because if I try to upload a file more than 20MB then it ...
1
vote
1answer
34 views

Use python to restart all the process

My platform is ROS Ubuntu in Raspberry Pi 2. I started a shell script by running python node to restart all process. However, when I kill the python node, everything started by the python node is also ...
2
votes
2answers
44 views

How to compare any string from output through shell script of unix command

I get a log file as soon as I run one command(process is still running in background). Now I want to fetch the status (clean or un-clean) from that log file. If status is clean then I will leave the ...
2
votes
1answer
24 views

How to run a timeout “within” a script?

I have a script which contains several commands, and one of them takes a bit of time. The script normally reads a list.txt file, and runs the commands on each row. The problem is some rows take a lot ...
2
votes
1answer
34 views

Differences how to run scripts at startup

I've read various questions about how to run script at startup but I'm not quite sure what the differences are and what's the actually the right way to do it without GUI. /etc/rc.local cron job ...
0
votes
1answer
17 views

Cron Script to run every 5 minutes

How would you use a cron deamon to execute a scheduled command such as gathering memory usage and adding that information to a file called /tmp/memory.usage, but only runs on Monday through Thursday ...
0
votes
0answers
52 views

My bash script for Grive2 works well in Ubuntu Mate but for some reason it doesn't in Lubuntu

I'm new and I'm learning English so please don't be too rude if i make things wrong, but tell me if I'm not doing them good, of course. Hello community!, by the way. Anyway, getting to the point of ...
0
votes
1answer
48 views

Bash script automation issue

I'm taking this out of context but this bit of my script doesn't execute properly: latest=$(ls ~/Videos/ -t | head -n 1 | sed 's/ /\\ /g') mpv ~/Videos/$latest I'm trying to automatically play the ...
0
votes
0answers
21 views

script not executed on start

I've created a script like this #!/bin/sh # /etc/init.d/xcode: change keyboard xmodmap -e "keycode 74 = backslash bar" I put it inside /etc/init.d I set executable option for all user I create a ...
0
votes
0answers
21 views

Script using zenity and ghostscript to compress PDF files modification

I need help to change the script I have to compress PDF files using Thunar file manager custom actions. The script runs well compressing one by one file, I want to make changes that all PDF files I ...
5
votes
3answers
224 views

Extract integers from file and output to another file?

I have the following file foo.txt: 1 AbcdJ 8192 Pak78 8291 I would like a bash script that extracts all the lines containing only integers (e.g. 1, 8192 but not AbcdJ or Pak78) and outputs it to ...
1
vote
1answer
22 views

How to make Firefox show a desktop notification by running a script through it (like a website would)?

I am needing to test a bug where Firefox 47 does not show desktop notifications for the majority of the time even when a site is meant to be making it generate them (this wasn't present in previous ...
-2
votes
2answers
36 views

How to set up a cron job to run every 10 minutes? [duplicate]

I have a python script, and i'd like to make it run every 10 minutes, how can i do this? Thanks in advance.
2
votes
1answer
17 views

Shell script in Ubuntu raspberry pi 2

I am writing the shell script in Ubuntu for raspberry pi 2. Here is my script. #!/bin/sh source /home/ubuntu/ros_package/devel/setup.bash roslaunch uvc_camera camera_node.launch & #Open new tab ...
0
votes
0answers
40 views

Can't run Python Script on double-click

I recently upgraded to Ubuntu 16.04 but lost all my installed programs for some reason and this is when my problem started. I could always run my scripts by double-clicking the icon, because I have ...
2
votes
1answer
63 views

Trigger if directory size exceeds threshold

I have written a shell script to backup data to s3 and i want to trigger this shell script when ever the system storage space goes critical lets say when the system reaches 80% of its capacity. I know ...
0
votes
0answers
25 views

Questions about IRC & IRC Scripting

I hope it's that I ask those questions here, I was looking for other places but lots of searching terms brought me here so.. :) I have a few questions regarding IRC and the scripting in IRC. :) I ...
0
votes
0answers
25 views

Having Trouble with this awk script

I've tried invoking the script below with the line awk 'filecount'. It should print out the file information and a line number, followed by the total number of files in the directory, but nothing ...
0
votes
1answer
38 views

Crontab runs /etc/init.d/ scripts but won't run service restart?

I am very new to Linux so please bare with me. I'm writing a script to restart mysql and send me an email whenever it goes down. I'm using crontab to run the script every x minutes. I'm having an ...
-1
votes
0answers
24 views

scripts in /etc/cron.hourly not executing

I have placed my mysql backup script in /etc/cron.hourly, i even made it executable and also the script starts with the line #!/bin/bash. But when i run sudo run-parts -v /etc/cron.hourly my backup ...
1
vote
2answers
58 views

Grep in bash script won't work properly

I know there are many similar questions arround the Internet, but I couldn't find a solution for my specific problem. I made this script for an assignment, where I want to find which combinations ...
0
votes
1answer
34 views

How do I make sure the touchpad is enabled on reboot?

Just installed Ubuntu Mate, and am facing a strange issue: I have to manually enable the trackpad every-time I reboot the system.. It's getting quite annoying, and if anyone can help out by creating ...
2
votes
1answer
89 views

How to extract specific numbers form files to solve an equation?

I have multiple files that look like this: // copyright kkshlglkf // lhafslghldk // rsghlgsrlskl // sgkg // sgrjgrs // Memory: BDRAM_SP // Bits: 32 // Mux: 8 // ladhdal: ...
0
votes
1answer
13 views

Trouble taking auto backup of mysql database to amazon s3

I am new to this concept and i am using ubuntu14.04 lts O.S. I created a bash script which would take backup of mysql db, and also created a cronjob for a desired time. The thing is the backup is ...
-1
votes
1answer
29 views

How to achieve sudo privilege in shell script? [duplicate]

how do I can achieve sudo privilege via the shell script without entering the password? Example: [user@user Desktop]$ ./script.sh [user@user Desktop]# which command should I try on the script.sh?...
0
votes
2answers
30 views

Automatic backup of Mysql database to Amazon s3 server using script and crontab

I am new to this concept so can someone please guide me the script code details and the proper usage of crontab while backing up database to amazon s3 server at a desired time. I went through ...
4
votes
1answer
33 views

One command to get a running py script ID then kill it

I once asked for a script to control unity launcher auto-hide behavior and the community here was kind and clever enough to give me exactly what I needed here. Now I wonder if there is ONE command ...
1
vote
0answers
20 views

Why is my script for the powerbutton not working under 14.04 LTS an 16.04 LTS any longer?

I have an little homeserver based on ubuntu 16.04 LTS without a graphical userinterface. He was set up with 10.04 LTS an always upgraded. In version 13 I changed the behaviour of the power button via ...
0
votes
0answers
14 views

delay in blkid picking up new volume

My computer is running Ubuntu 16.04 LTS. I am writing a python3 script which starts an iscsi connection to my nas using iscsiadm and then runs a psql database cluster on there from my computer. My ...
1
vote
3answers
68 views

How to write a script that generates a text file and opens it?

I have recently started using Linux and I want to create a script that will do the following: Generate a text file where the first line is: Work Plan {todays date} Save it with the name work_plan_{...
2
votes
1answer
42 views

How can I get a directory name by a window dialog called in shell script?

I have a shell script and want to get a directory name chosen by a nautilus dialog (or other tool). Ex: #/usr/bin/bash # choosing a path name export my_directory=`pwd` # open a nautilus dialog (1) # ...
0
votes
1answer
40 views

Pass a Number Value into a Shell Script

I regularly run a .sh script that has a list of menu options and expects a value from 1-7 that corresponds to a list of menu options. 99% of the time I use the same option (#6) so I'm trying to figure ...
4
votes
0answers
52 views

How to catch the command failure events in ubuntu?

I am trying to execute the script whenever the command fails. We all know that if the command is failed $? value will not be equal to 0.It gives the value 127 if command fails. The script is ...
0
votes
0answers
18 views

Why do some startup applications stop executing after some hours?

There is no problem with the python Code. The shell script is supposed to run in an infinite loop, and has been added to the startup application as sh /Location_of_file/filename.sh i=1 while [ "$i" -...
5
votes
1answer
73 views

How can I always keep the Desktop icons organised, and sorted by name?

I would like to keep my Desktop always organised by name. How can I achieve this? Desktop not organised by name: Desktop after having organised by name:
2
votes
0answers
30 views

How to add custom menu items to system menu?

I'm wanting to write a few shell scripts which I can run from clicking their respective items from the system menu (with the power options). I cant seem to find anything online about adding items to ...
0
votes
0answers
26 views

LSB script that runs on reboot or shutdown

I am trying to write a LSB script that runs on system shutdown (Ubuntu 16.04). My steps so far: copy skeleton script from /etc/init.d: cp /etc/init.d/skeleton /etc/init.d/shutdown_script edit the ...
2
votes
1answer
54 views

Unable to run a script from a text file

I have a simple script that I want to be able to run by double clicking a text file and having it run in terminal so i don't have to do it manually #!bin/bash $ cd /home/tyler/df_linux $ ./df I've ...
1
vote
1answer
16 views

How to check if directory is not containing hidden dir and one specific dir

I'd like to see if "/tmp" dir contains hidden dir and dir named "test" Currently ls -la /tmp contains below . .. test I'd like to check if /tmp doesn't contain anything else besides above using ...
2
votes
1answer
24 views

How can I view the output of a .sh file placed in rc.local?

I wrote a short script to run lampp's php script. It is residing on rc.local where I first run opt/lampp/lampp and then, run the sh (which is infinite) that is echoing to the output buffer infinitely. ...
15
votes
1answer
553 views

How to set the first picture of every folders as their folder icons?

If there are pictures in folder A, B, C.....Z, how do I automatically set the first pictures of these folders as their folder icons? Is there a way like a script or something else?