A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.

learn more… | top users | synonyms (1)

4
votes
0answers
172 views

GRUB 2 scripting: convert device name in GRUB notation into a Linux device name

I'm trying to use partition labels (or UUIDs, that does not matter) to select root partition without use of an initrd/initramfs. With initramfs, this is fairly easy: root=LABEL=... or ...
3
votes
0answers
23 views

Automatically restarting process in the X server

I would like to know how to have a process that starts with the X server and automatically restarts when it stops running. I am running Ubuntu 14.04 with a KDE 4.13.3 desktop. I am running the ...
3
votes
0answers
18 views

End recording once silence is detected

I've been using something like this up to now: End sox recording once silence is detected But now I'd like for the audio source and recording mechanism to be separate. I can get the source as an ...
3
votes
0answers
48 views

How do I schedule a cron task to run

I'm looking to crontab a script every hour starting Friday at 5pm... ending Monday at 5am. This script checks if it's completed this week and if it's currently running. If no/no, start task. Off the ...
3
votes
0answers
198 views

How to make a PAM substack “requisite”?

For the auth section of my PAM configuration, login and mdm etc. call common-auth. I have common-auth calling the following as a substack (as auth substack krb5ldap-cache-auth): auth optional ...
3
votes
0answers
55 views

Notifying program that X session is shutting down

Ok. I understand X session is a bit vague here so let me clarify what I mean by the phrase. I mean the situation where a person has been presented with a display manger screen ( eg xdm, kdm, gdm, mdm, ...
3
votes
0answers
1k views

How do I reset a USB device using a script?

I have a USB GSM modem that does not always work property (Huawei E367u-2) Sometimes it gets reset (USB device disconnect/reconnect in logs) and when it comes back up, it has different ttyUSB numbers. ...
2
votes
0answers
62 views

“Restart” a process in the same terminal?

I put "restart" in quotes because the following question on SO illustrates what I'm trying to do: http://stackoverflow.com/questions/27957091/restarting-a-process-in-the-same-linux-terminal I'm ...
2
votes
0answers
69 views

Copy folders at once

I want to copy a large number of folders at once not one by one. Is it correct to use the following code ? Is it helping to run the command cp for all the folders i at once? #!/bin/bash foreach i in ...
2
votes
0answers
97 views

How can I run a KDE plasma script from command line without GUI?

I want to run a plasma JavaScript file from command line, but the only solution I found so far involves a graphical script editor and requires a user interaction to run the script: qdbus ...
2
votes
0answers
68 views

Remote script cleaning up

I run a remote script using ssh: local script: local_command ssh -p 222 user@server 'sh -s' < ./remote_run.sh remote script: some_command & sleep 10000 trap 'echo exiting' SIGINT SIGTERM ...
2
votes
0answers
142 views

How to print the first three lines and last two lines of a file using perl?

Through the command line I draw one or several of the patterns found text.xml file: perl -ln0e 'while(/<PMResult.*?<\/PMResult>/gs) { $x=$&;print $x if $x=~/BCCEL-[1-3]/}' text.xml I ...
2
votes
0answers
64 views

Automating startup tasks

I have a "morning ritual" that occurs on every boot of my machine: starting up a few browser tabs, starting up skype, starting up terminator and subdividing some screens, etc. Is there any tool that ...
2
votes
0answers
734 views

Cron file syntax checker/validator script

Does anyone know a script (bash, perl, php ...) to validate the syntax of crontab files? I found this http://www.intuitive.com/wicked/showscript.cgi?053-verifycron.sh but just Vixie cron notation is ...
2
votes
0answers
173 views

How to emulate a KWin effect by command line?

I would like to apply the Toogle Invert Effect when I start my system. So, I need to know how to call this KWin effect using the terminal. OBS.: I'd tried xte "keydown Meta_L" "key i" "keyup ...
1
vote
0answers
9 views

VBox headless: install Archlinux without RDP

I have script to setup headless machine on remote headless server, connected by ssh. It will create machine, attaches disk and archiso, and launches installation. Also, I have script to setup ...
1
vote
0answers
52 views

Why the output is not written to log from expect script

I am trying to write the output of the netcat command including the command also to a file by logging into remote servers. But it is not writing. What am I missing ? #!/usr/bin/expect -f set user ...
1
vote
0answers
35 views

programmatically alter kde file associations

Problem: In kde I want to remove a particular file association from every file type Details: I wanted to try out clamTk as a companion to clamAv. It didn't suit my needs so I uninstalled the ...
1
vote
0answers
35 views

Service script and shared libraries

I have the following simple script IPN in CentOS 6.5 in /etc/init.d/ #!/bin/sh # chkconfig: 2345 05 06 cd /root/IPNHost . /etc/rc.d/init.d/functions start() { echo -n $"Starting..." ...
1
vote
0answers
23 views

OCR for getting text from an image. Error management

I want to use an OCR program to obtain some text in an image. The text is not black on white so I don't know if it will be possible. wget -q -O image ...
1
vote
0answers
58 views

Logrotate or scripting to manipulate log file

I want to make sure that a certain log file gets empty when it reaches a specific size. I first used logrotate since the man page says: It will not modify a log multiple times in one day unless ...
1
vote
0answers
40 views

Restore Trash Script not working

I made a script to send a file to a trash folder... echo "Are you sure you want to move this file to the Recycle Bin?" "(Yes/No)" read ans case "$ans" in Yes) echo "$(readlink -f "$1")" >> ...
1
vote
0answers
69 views

Hotmail not receiving emails from a script, but works from the server

I have a working mail server running Debian stable, the following elements are working. SPF DKIM rDNS My IP is not listed in any backlist, I used: mxtoolbox.com for all this. My problem: Sending ...
1
vote
0answers
385 views

How to Download the latest file from SFTP server?

I need to first get the data a file was uploaded to the sftp server on, then check whether it was today's date and if so download it else echo "File not found". I would like to do all this using a ...
1
vote
0answers
17 views

Is there a way to run a script right after an account deactivated?

What I want to do is create a temporary user like this useradd -m -e 2009-12-01 -c "Temp Account" tempUser so that when the account expires (like this one would on December 1, 2009), the computer ...
1
vote
0answers
47 views

Need a script to send an email when an input has not changed for more that 30 minutes

I need a linux scrip that will send an sms when there is an input change and it has not gone to the initial state after 30 minutes, I have the following so far, but, I am sure there are few things ...
1
vote
0answers
104 views

Maintain screen session when executing shell script on boot

Solved: I solved this problem by introducing a delay before executing the script: @reboot sleep 60; /root/start_server.sh On Ubuntu 14.04, I have a crontab entry set to run on reboot: @reboot ...
1
vote
0answers
26 views

Is there a version of script that plays nicely with vim?

man script says: Certain interactive commands, such as vi(1), create garbage in the type‐ script file. Script works best with commands that do not manipulate the screen, the results ...
1
vote
0answers
75 views

xdotool random/more natural delay?

For automated testing of some applications, I would like to emulate the users behaviour. I know I can user the xdotool type --delay option, but I would like a more natural delay. The easiest thing ...
1
vote
0answers
37 views

script works fine on client machine but doesnt work in nagios

purpose: nagios check for kannel stuck Date : dec 8, 2013 /etc/init.d/kannel status | grep -i -E "SMS: received" | awk '{ print $3 }' > kannel_temp_1.txt /etc/init.d/kannel status | grep -i -E ...
1
vote
0answers
47 views

List Mails by subject

I'm writing a script to send mails from a mailbox on a remote server and a script to check if the mails are received at another remote server. For this I have configured mutt. What I now need is to ...
1
vote
0answers
345 views

gnome-terminal cmd leaving processes open after closing parent window

The following simple command should demonstrate my issue: gnome-terminal --tab -t "Tab 1" -e "/bin/bash" --tab -t "Tab 2" -e "/bin/bash" This should open a new window with two tabs and an active ...
1
vote
0answers
140 views

rsstail Not Printing Output

I've installed rsstail 1.8 on my linux box and everything seems to be going smoothly, knock on wood, except for the part where rsstail isn't printing the streams. Running the command, I see that it's ...
1
vote
0answers
95 views

Perl Script to Display Pork Offline Message

I use pork 0.99.8.1 on openSuse 11.4 for my AIM account when I don't want to use irssi + bitlbee. The only problem I have encountered so far is that offline messages are not displayed. I just get a ...
0
votes
0answers
42 views

How to parse an awk variable

I'm trying to pull some information out of a log file, looking back over a specific period of time (e.g. the past hour). I've found the following awk construct that works, capturing the data as a ...
0
votes
0answers
18 views

Create complex installation script for Linux (Centos)

For deployment of a complex system I would like to create a script that runs all compilations and set up. I am looking for an existing product that interpret installation scenario and performs all ...
0
votes
0answers
14 views

check media resolution if resolution is big ffmpeg it, if output is smaller than original delete the original else delete the output

I have my storage VPS filled with videos, and hoping I can free up some space, their resolution is pretty big so I decided to re encode them with ffmpeg to a smaller resolution, I am doing every thing ...
0
votes
0answers
54 views

grep command with pipes, how to implement in script?

I'm new to expect scripting and trying to get below script to work. The script logs in to a server and reads a config file ($val in the script) for the values of "cps" and then presents a total ...
0
votes
0answers
16 views

DHCP server easy switch

i have a server, running Centos, that bring reserved DHCP for mac to 5 computers, but they have diferentes ip depending on some external parameters, and i change manually everytime, and i want know ...
0
votes
0answers
24 views

Systemd user specific service and timer

I have installed arch recently and added a few of my own services, for example the acpi_call commands and such. Now I want to create a systemd service that runs every 5 minutes and execute a script. ...
0
votes
0answers
24 views

Script for auto-starting programs after restart

Is there any script or program to make all open programs auto start after the system restart? Like the one on the mac that gives you the option to reopen all programs after restart or shutdown
0
votes
0answers
27 views

Rancid for Dell Powerconnect 5524

I´m trying to back-up the configuration of a Dell Powerconnect 5524 switch using RANCID. The script I'm using is srancid. I've also tried with dell and dlrancid, none of them worked. Srancid works ...
0
votes
0answers
20 views

How to use “on commit” with isc-dhcp-server (IPV6)

I try to use the "on commit" trigger in isc-dhcp-server. I made prefix delegation, and I have problem with updadting routing table, so i want to use the isc dhcp triggers to manually update routing ...
0
votes
0answers
16 views

Perform task on waking up from suspend

I have program that misbehaves when my pc wakes up from suspend to ram, it starts using up to 40% of processor time so i usually have to kill it manually. How can i set specific command (pkill in ...
0
votes
0answers
19 views

Add extra parameter for text label or just echo it outside the call?

I have written a program that allows me to test my functions. I call it like this: do_test function_name expected_result parm1 parm2 For example do_test add_2_nums 10 5 5 Now I need to call the ...
0
votes
0answers
20 views

Dual partition scheme with GRUB

I would like to use a dual partition update scheme for some servers like CoreOS is doing here. Basically the process is the following: The computer has partition A and B, each with a full Linux ...
0
votes
0answers
29 views

How to extract data from the file

How can I extract data from "config.tab" files located in different directory and put it in a single text file. Example: /servers/FRCOLP0056673/config.tab /servers/FRCOLP0056674/config.tab ...
0
votes
0answers
73 views

Increment Numbers in URL?

I want to create a list of URLs. The URLs have two sets of identical numbers which need to be incremented by 1: http://sample.com/poilus/cwrgshs/192/192.html ...
0
votes
0answers
19 views

What's the difference between `set` and `modify` in *nix command syntax

I'm creating a new custom script that will be able to add, modify|set and delete certain rules of DNS records. I was looking for a proper naming convention of *nix tools that might help me name the ...
0
votes
0answers
12 views

Creating a bootable 'system profiler'

I'm trying to create a program using a small linux distribution that can be booted from a USB (kinda how DBAN operates). The program with simple output system specs upon request, no GUI, simplicity is ...