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)

7
votes
2answers
119 views

A shell-like environment for binary processing

This question came to me a couple of times before, now in response to the question Loop through binary data chunks from stdin in Bash Answers given in ...
2
votes
2answers
44 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
2answers
2k views

grep output of expect script

I'm trying to run some expect language, and grep/parse the output all in one script. I want to grep the output of and look for "error" (I should note that standard linux commands like awk, sed, grep, ...
1
vote
2answers
418 views

Import single rows from SQLite to MySQL?

I need to do some kind of incremental import again and again from a SQLite 3 database to a MySQL database. Column names are the same in both databases. Is there a good way to do this by a script ...
6
votes
1answer
242 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 ...
4
votes
1answer
225 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
111 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
25 views

Fetching Remote Windows System Information From Linux Server

I need a script/command that would fetch Windows System Information (Host Name,User Name, Domain, OS Info, Hardware Info, Memory Info, processor Info, etc) by running it on a Linux Server (RHEL 6.5 ...
2
votes
1answer
676 views

Quickly check whether many network hosts are up-and-running

Objective: check if a host is up-and-running on the network, with a method that can be efficiently parallelized over many hosts. Emphasis on a QUICK turnaround of the check. Reason to emphasise ...
1
vote
1answer
50 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
51 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
232 views

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

I'm trying to run some commands from a Bash script, that when Enter is pressed should give some output. An example is nmap. When calling a few different nmap scans from a Bash script, pressing Enter ...
1
vote
1answer
86 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! ...
1
vote
1answer
637 views

setcap error on Debian Squeeze: “unable to set CAP_SETFCAP effective capability: Operation not permitted”

My python script needs at least the CAP_NET_RAW capability, because it's using a pcap library, but I don't want to use sudo (and in fact sudo causes my script to not work properly, with the script's ...
1
vote
1answer
450 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 ...
0
votes
1answer
93 views

How do you keep the password hidden when invoked during the su command?

This is the first time it has happened to me where I am using the su command and it actually displays the password on the terminal and doesn't stay hidden. Here is my code snippet: sshpass -p ...
0
votes
1answer
52 views

How to execute grep in tcl for getting XYZ-123 type pattern

can I execute this grep command in TCL? grep '[A-Z][A-Z][A-Z]\-[0-9][0-9][0-9]' file1 > file2
0
votes
1answer
65 views

Prompting when redirecting content of script to remote machine

I have simple script: #!/bin/bash while getopts ":u:" opt; do case $opt in u) USER="${OPTARG}" ;; \?) echo "Unknown flag has been used: -$OPTARG" >&2 exit 1 ...
0
votes
1answer
48 views

Need to grep for specific lines from ongoing log and save it in some file

So, let me start with the overall outcome that i want to achieve. There is just one log, which will have info on certain devices, that i am upgrading. I use "tailf log" to monitor the log. Now, ...
0
votes
1answer
415 views

How to execute Netscaler commands through a remote machine via SSH connection

I have been trying to execute some NetScaler commands like "bind" & "unbind" through a Linux Box via an SSH Connection. Now the Problem is, Manually we are able to enter & execute commands on ...
0
votes
1answer
304 views

Using alias in another script (ksh)

I'm writing a ksh script, and I'd like to use a command define by an alias in my .profile file, in my script. I tried this command in the folder containing my script, and it works. However, in my ...
0
votes
1answer
227 views

PuTTY and PowerTerm scripting Problem, Open a just in time URL via Samba share

I'm sshing into a fedora server using Powerterm (an expensive overly priced, license based, terminal emulator). The server uses an ancient form of (what I'm told is similar to) cobalt. I have no ...
-2
votes
1answer
23 views

I want a script to do following simple task?

My input is : a a l a c g b c ... and so on rando alphabets. A command or a awk statement which will give me: a-1 1-2 l-1 a-3 c-1 g-1 b-1 c-2 basically counter for all alphabets and ...
-2
votes
1answer
82 views

automatic capturing top output by cronjob CENTOS 6.5 x86_64

I have this command: top -n 14400 -a -b -d 1 > /toplogfile.txt I want to make a script which is run by cron every day to capture top output, and if it is possible gzip the output file after the ...
-2
votes
1answer
121 views

bash script user promt for prefered directory

hey all i am attempting my first bash script. so i would like to prompt the user to find out where they would like a cloned repo to be saved currently i am assigning it like this ...
4
votes
0answers
35 views

How to detect a desktop application hanging

I want to write a script that will detect whether a particular desktop application is responding and kill it. Is this possible? I know I've seen the GNOME desktop put up a "Application is not ...
4
votes
0answers
74 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 ...
4
votes
0answers
410 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 ...
3
votes
0answers
33 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
52 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
622 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
10 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
37 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
51 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
59 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
154 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

Converting .docx files to plain text and preserving line breaks to maintain line number references to source document: howto & implications?

I'm exporting MS Word content to plain text for use with text&file utilities. I have a constraint where the line numbering feature has been enabled in the MS software, and any reference to line ...
1
vote
0answers
29 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
39 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
212 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
100 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
531 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
91 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
24 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
24 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
26 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
27 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
28 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
58 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
85 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 ...