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)

6
votes
1answer
295 views

How to change Vim's command type mode programmatically?

Is there a simple way to switch from one command type mode to another without loosing the current command line? In my ~/.vimrc file I remap the <space> and <c-space> character, coming ...
6
votes
1answer
502 views

Can capabilities be used in scripts without setcap'ing the interpreter binary?

Right now I'm using cap_net_bind_service MY_USERNAME in /etc/security/capability.conf. Now I just need to set cap_net_bind_service+i on the interpreter of my favouite scripting language to be able to ...
4
votes
1answer
245 views

vim auto complete custom list

I had these two questions about this function " how do I load a file into a list here? " set some variable func! CustomComplete() " and then read the variable here so that b:list = a \n split ...
3
votes
1answer
138 views

Using tcpdump to log blacklisted IPs

I am using tcpdump to log traffic outbound on a network. I would like to be able to log traffic on a host or IP-only basis but then I would like to be able to log large numbers of potentially ...
2
votes
1answer
77 views

Renaming the files and move to other path

I need to rename the files given below and move to some other path 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44 ...
2
votes
1answer
109 views

Mac equivalent application “shortcat”

There is a mac application called Shortcat and it make me envious. For those of you averse to clicking links here is a summary: Keep your hands on the keyboard and boost your productivity! ...
2
votes
1answer
487 views

Script that unpacks a initrd, allows editing of the preseed.cfg and the packs it to cpio and gzip again

I want to program a script that allows what is said in the title. So basically I gunzip the initrd, than unpack the cpio, open vi to allow editing, save, pack with cpio, and gzip again, so nothing ...
1
vote
1answer
43 views

How do you make case statements with ranges

I'm supposed to: Make a case statement that will display the a grade after input. With no loop or conditional. A=90-100, B=80-89, C=70-79, D=60-69, F=0-59 This is what I have so far: ...
1
vote
1answer
100 views

Startup script with LSB headers not working correctly (dependency problem)?

I am creating a startup script for my Ubuntu 14.04.1 LTS server. The script need to be run after the Rabbit MQ server. The Rabbit MQ startup script says it provides "rabbitmq-server". So I put this ...
1
vote
1answer
413 views

Change a value in a config file, or add the setting if it doesn't exist?

When modifying config files from the command line, I often want to find the setting in the config file and modify that line if that setting exists. If that setting doesn't exist, I want to add it to ...
1
vote
1answer
284 views

securely automating a script which requires a key to do its task

I have a script that downloads bank transactions to store in a database. To get these transactions requires a password for each account. The database is encrypted and requires a key to access it. All ...
1
vote
1answer
370 views

How to see interactive output when running nmap from a bash script?

I'm trying to run nmap from a Bash script, in a way so that when Enter is pressed it should give some output, as happens when running directly from the commandline. When calling a few different nmap ...
4
votes
0answers
135 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
124 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
53 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
918 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
55 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
58 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
58 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
126 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
62 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
166 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
22 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
26 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
35 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
108 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
42 views

Neutralisation of data from Windows to Unix

I just noticed that other platforms files (Windows) had to cause me many bugs, like here, in my regexes. Mostly, the line ending ^M. There seems to be many ways to do dos2unix, like here described. ...
1
vote
0answers
16 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
44 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
70 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
19 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
35 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
44 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
322 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
120 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
629 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 ...
1
vote
0answers
92 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
4 views

pop up panel applets

Im using debian 7.7 with gnome classic fallback mode I like how I can put programs and scripts into the panel in custom application launchers. What i want to do is have an analog xclock is fine, in ...
0
votes
0answers
38 views

Copy old cert files and keep the directory path on server

I need to copy old certificate files to new temp directory but keep the directory structure. The certs files are in directories on the server and need to copy all to a temp folder before removing. So ...
0
votes
0answers
47 views

Unix Shell script to delete all traces of itself after execution through crontab

My Question has 2 parts. Help with both parts is greatly appreciated. GIVEN INFO: - Lets assume there are 2 Folders, Folder A and Folder B. - Folder A contains many files. - Folder B contains the ...
0
votes
0answers
34 views

auto installing dropbox daemon(dropboxd) with profile signed in automatically script issue

I am trying to install dropbox automatically in my server auto-install script so when I spawn a new VPS instance I'm able to have dropbox installed and have the credentials already inputed via the ...
0
votes
0answers
55 views

bash script loses readonly value after first time thru loop

I have a bash script which seems to lose the value of the readonly constant after the first time thru the for-in loop. For example: #!/bin/bash readonly DIR="./groups/" for output in "${array[@]}" do ...
0
votes
0answers
50 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 ...
0
votes
0answers
44 views

shell script for executing mux verilog code

I have a verilog file mux.v and testbench muxTB.v. used ifdef caeses for behavioural model ifdef struct for structural model I have executed these files using the commands iverilog mux.v muxTB.v -D ...
0
votes
0answers
31 views

convert many eps files in a single pdf or ps file using shell scriptI

I have SSt12.OLR.1.eps, SSt12.OLR.2.eps SSt12.OLR.3.eps SSt12.OLR.4.eps ......and covert these eps files into single pdf or post script file. please suggest a shell script.
0
votes
0answers
35 views

Is it possible to auto translate words via scripting language?

Some words in String.log as following: English Home Wait Come Back And I want to translate words of String.log into French,like this: Anglais maison attendez venir arrière As we all ...
0
votes
0answers
61 views

replacement script multiple targets

I have this input file Name=code_229633_138;isoforms=1 Name=code_229633_138 Name=code_229633_138;Target=R77_09738T0 Name=code_230519_1;isoforms=1 ...
0
votes
0answers
133 views

Video tools for creating presentation

I have captured video (with audio) from presentation, slides (just images), and array of times (when slides was listed). Goal is to create presentation video: big slide with small video frame at the ...
-1
votes
0answers
23 views

Ping Printer then Execute Command

I have many printers on my network using CUPS and a few pause occasionally. I can't find any consistency between them to isolate the cause so in the meantime I've made a script to view all paused ...
-2
votes
0answers
37 views

making a delete script and a restore script

I'm looking to create two scripts; one to "delete" a script, and one to "restore" I need "del " where this will move the file located at to the dustbin directory in a way that will allow it to be ...