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)

1
vote
2answers
25 views

script to add users to otrs

Im looking for a fast way to import customer users into otrs (ticket system) I have an export from Active Directory with: firstname lastname password email username There is a script in the otrs/bin ...
0
votes
1answer
959 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 ...
2
votes
2answers
48 views

Using Diff on a specific column in a file

Will it be possible to use diff on a specific columns in a file? file1 Something 123 item1 Something 456 item2 Something 768 item3 Something 353 item4 file2 Another 123 stuff1 Another 193 ...
3
votes
1answer
24 views

Retrieve X11 window ID of a just-launched GUI-program

I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround: myprogram & sleep 1 winID=$(wmctrl -l | ...
0
votes
1answer
40 views

Create A Script That Responds To A Password Prompt

I'm writing a shell script that will respond to a prompt. For example, when I execute a file, the executed file will then prompt the user with this: Please enter the password: Then I want the script ...
-2
votes
2answers
37 views

how to take the file names from folder

i want to write a program for the below logic: Take the names of files in a folder For each file: print file name move the file to another new folder (with the name in dd_mm_yy format)
0
votes
1answer
203 views

Got “syntax error near unexpected end of file” in bash script

I'm making an script that gives me a day like this jjj/yyyy when I give it a day like this dd/mm/yyyy and I need it to have an error when you don't write correctly but I'm starting and it's not ...
12
votes
4answers
376 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 ...
0
votes
1answer
23 views

Interactive shell in background inside another shell script

I have some problems when trying to run an interactive sh session inside a shell script. The inner sh process uses all the CPU and never terminates. To reproduce the issue simply create a file named ...
-2
votes
1answer
43 views

Output a colon delimited file to another file [on hold]

I have the following example file: root:server1:2014-12-12:x:Open:adm bin daemon lp mail other root sys users sectmp:server1:2014-12-12:x:Open:users smbnull:server1:2014-12-12:x:Locked:ids ...
1
vote
0answers
17 views

Search for the multiple string and print it to file in order [migrated]

I have a data as below, and I need to filter out the Author with "file changes and Lines Modified/Added Lines Deleted" And I need to separately print it to file with respect to Authors. If there are ...
-1
votes
0answers
32 views

string bash variable value is not copied to another variable.why? [on hold]

I have this code snippet BCR2000_CHAN=$( jack_lsp | grep BCR2000 | grep capture | grep "MIDI 1" | sed -e 's/^.*\[\(.*\)\].*$/\1/' ) BRC2000_CHAN2=$( echo $BCR2000_CHAN | awk '{print $1}' ) ...
1
vote
1answer
24 views

Shutter Script(s)

When i play some games with wine , i must not change the window , because of that , the game crash or that window are fill of black. im using xfce4 desktop , when i press "PrintScreen" key from ...
1
vote
5answers
211 views

Is there a difference between ./script and bash script?

Given a shell script file that begins as #!/bin/bash # (bash script here), and has been chmod +xed, is there any difference in running ./script and bash script from the command-line?
-3
votes
1answer
31 views

Have a script (on server) download a file on your computer (local machine) [on hold]

I am setting up a special kind of script for a project that I am working on. I'd like my script, when executed, to take a file that is on the server and put it on the computer. I have no idea how I ...
9
votes
3answers
685 views

How do you continue a sentence with a command inside

For example, I have been trying to say "There are 10 people online at the moment" in my script file. I can never seem to get the command working without the "people online at the moment" part on the ...
167
votes
23answers
98k views

Repeat a Unix command every x seconds forever

There's a builtin Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...
2
votes
2answers
43 views

Find duplicate PDF files by content

Some journals generate a different PDF for each download. APS for example stores time and the IP address in the PDF. Or there is a paper version with hyper links and one with text references. How ...
0
votes
2answers
32 views

ifconfig -a get needed data grepping

If I issue following command to obtain network interface data: [root@pi lib]# ifconfig -a eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.154 netmask ...
0
votes
2answers
48 views

Run two scripts at the same time

I want to run two scripts at the same time. How exactly do I do this? If I have a variable called foo in script1 and change its value to 5, and if I'm using a variable with the same name in script2 ...
0
votes
2answers
57 views

Check if a file is a text file in bash

I am trying to make a check to see if the file being attached to the email is a text file, and if it is not it returns an error. However during testing, I provide a valid text.txt and it returns the ...
1
vote
0answers
20 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
5answers
98 views

How to get the unique count of a particular part of a string

I have a set of data in a file. psf7433-nlhrms unit7433-nobody unit7333-opera bpx7333-operations app7333-osm unit7330-partners psf7331-pdesmond unit7333-projm mnp7330-redirect unit7333-retailbanking ...
1
vote
2answers
59 views

How to grep for same string but multiple files at the same time?

I have a set of log files that I need to review and I would like to search specific strings on the same files at once Is this possible? Currently I am using grep -E ...
2
votes
3answers
65 views

How can I print only variables defined inside my shell script?

Lets supose some bash shell script like: #!/bin/bash a=3 b=7 set -o posix set In this case, the execution of the set variable or some other of the commands to print environment variables ...
0
votes
1answer
40 views

Script thinks input is a command?

I'm just getting started on a script that does basic shell commands, but the second function, which is supposed to take a valid year and month and plug them into cal, is returning with this error: ...
0
votes
1answer
15 views

sftp script for getting multiple folder from remote machine [closed]

I m looking for a script that will get multiple folders from remote machine to local machine using sftp. Please note that both of machines are linux,
2
votes
4answers
2k views

Shell script to validate mount point status in the linux server

I'm in need of a script which should work as below. A script where it would validate if that specific mountpoint is currently mounted on the server. It would search for mountpoint name in /etc/fstab ...
1
vote
1answer
403 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
2answers
41 views

untar shell script

i have a directory in which there are multiple tar files like tweets10_1.tar tweets10_2.tar tweets10_8.tar now i want to untar these files and keep them in a directory structure like 10_1 10_2 ...
2
votes
2answers
393 views

How can I automatically silence my computer at night?

I would like to set my Ubuntu computer such that I can't hear any audio between 9:59pm and 8:00am. How can I do that?
0
votes
2answers
22 views

find parent string based on regex

No sure if I can do this easily but: I have a file like VDS|name=vds01|another_parameter vol=disk01|parameter|dev=/dev/dev/my_dev1|parameter_A=some_value1 ...
2
votes
1answer
48 views

Can I control a graphical program from the command line?

How can I enter text in the text fields of the window shown by a program in an automated manner?
9
votes
9answers
12k views

Automatically run commands over SSH on many servers

There is a list of IP addresses in a .txt file, ex.: 1.1.1.1 2.2.2.2 3.3.3.3 Behind every IP address there is a server, and on every server there is an sshd running on port 22. Not every server is ...
2
votes
2answers
826 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
2answers
707 views

Changing user to root when connected to a linux server and copying files

My script is coded in a way that doesn't allow you to connect to a server directly by root. This code basically copies files a server to my computer and it works but I don't have access to many files ...
0
votes
1answer
59 views

A shell script that give the CPU information [closed]

Can someone help me to write a shell script that'll give me the following information: The state of the process; The time it passed the process in the CPU; The total memory used (in KB); The number ...
3
votes
2answers
4k views

Javascript to HTML converter?

Take for example this snippet of code on a web page. <html><body> <script language="javascript"> document.write("The cat"); document.write(" sat on the mat"); </script> ...
0
votes
1answer
23 views

Sendmail shell script not working

Can anyone help me please. I'm struggling with a issue since hours and can't seem to fix it. When I execute this script via shell it works and I also get the right email output sent to me, but when ...
-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 ...
-7
votes
3answers
59 views

How do you print the current month, day and year using awk and date?

I can't seem to grab the month, day and year using awk '{print $2, $3, $6}' date Does anyone know how to?
0
votes
1answer
35 views

Shell script runs differently when schedulled with cron

I have a strange problem with my backup script. To begin with, this is the backup script: ########################################################### # CODE BEGINS HERE ...
2
votes
4answers
4k views

Bash eval array variable name

Here is my bash case: First case, this is what I want to do "aliasing" var with myvarA: myvarA="variableA" varname="A" eval varAlias=\$"myvar"$varname echo $varAlias Second case for array variable ...
3
votes
1answer
48 views

Export passwords from the `pass` password manager

I've been using the pass password manager for a year or so now, and it's awesome, but sometimes I like to test other password managers and then I need my passwords back. So far I've just been adding ...
1
vote
1answer
99 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
3answers
62 views

How I can determine the latest version in URL?

I'm trying to put a "function" inside of a script to install the latest version of "TeamSpeak3" Client and make all configurations. My problem is I don't know how to make a function to test the ...
1
vote
5answers
98 views

find the max value of column 1 and print respective record from column 2 from file

How to find the max value from the column 1 and echo the respective path location from a file which contains n number of records. $ cat version.log 112030 /opt/oracle/app/oracle/product/11.2.0 ...
0
votes
0answers
11 views

Directly start an application in a new screen/tmux session [duplicate]

Is there a way to start a new screen or tmux session, which directly executes a given command/application then detaches again? In pseudo-code something like tmux new -s ft_session --execute python ...
1
vote
1answer
48 views

Add 10 to a value in large xml file

I have in a large xml file some hundred svg graphs where I want to change the <svg:g transform="matrix(1 0 0 1 59.06 88.74)"> 88.74 to 98.74 i.e to add 10 to every line that starts with ...
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 ...