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
3answers
30 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
65 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
9 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
39 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
491 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 ...
1
vote
2answers
451 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 ...
7
votes
4answers
1k views

How to constraint time a program runs in Linux?

I have several simulations to do, each is invoked with python simulate.py <parameter list>. The problem with these simulations is that some of them hang without quiting, which prevents me from ...
-3
votes
0answers
53 views

Does anyone know how to make a text based game in Unix [on hold]

please help me I don't know what I'm doing send a link from a video or code I only know Unix code
-2
votes
0answers
33 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 ...
1
vote
0answers
25 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")" >> ...
0
votes
1answer
13 views

Cannot stat error?

Running a "restore" script which moves a file previously deleted (moved to a trashbin folder) back to where it came from. Running the secondary script I receive this error... "mv: cannot stat `test': ...
2
votes
3answers
53 views

Writing a script that outputs local users and their password expiration date

I'm new to Linux and scripting, and was doing a practice problem and am stuck on it. I'm supposed to write a script that outputs local users real name and their password expiration information. This ...
1
vote
0answers
58 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 ...
3
votes
2answers
54 views

One for loop for many tasks

The output of this code is two txt files. Can I make one for loop for both of them. i.e one for loop to give me two or more outputs? In ID1 and ID2 I have names for files. I want to print the first ...
4
votes
6answers
166 views

Search for an user name in file and output the user's phone number

First I made a file called telephone containing: Jan;032569874 Annemie;014588529 Hans;015253694 Stefaan;011802367 And what I now need to do is make a script where the user inputs a name ...
-5
votes
1answer
42 views

Merging spreadsheets?

I have a list of LibreOffice spreadsheets (xls files) each one has one sheet. I wanted to merge all those spreadsheets in one big spreadsheet including all the tabs/sheets inside it. For example: lets ...
2
votes
1answer
25 views

Scripting: Counting users logged in onto the system

I need help with the following script. #!/bin/bash #Solution script1 who date +"Today %d %B, there are $# users logged in onto the system" In the background user1 has looged in onto tty2 and 3 and ...
0
votes
4answers
80 views

Can you put an if statement within an until loop?

We have to make a script with one until loop to repeatedly ask the user for a number. - If the number is not 50, display the message, “Wrong number; try again.” - ask for another number. - If the ...
1
vote
1answer
35 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: ...
2
votes
1answer
482 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 ...
5
votes
3answers
540 views

Shorter command for deleting files

Our web server was originally maintained by a different company. They wrote a short script to clean out cache files. Their file has several lines that read like this: /usr/bin/find ...
0
votes
0answers
56 views

I need a script master!! [closed]

i'm sorry if i will sound a total idiot to the most of you. Thanks to everyone who will have the patience to read the whole message. i bought this software called ivory for mac -which is a great piano ...
2
votes
2answers
59 views

Inputting user input automatically through bash script? [duplicate]

I am creating a bash script which creates a user and sets a password. When the command "passwd user" is run it requires the user to enter a password and stops my script. Is there any way to fulfill ...
0
votes
1answer
3k views

Automating excel report

Could you please help me for the below concerns. I'll be executing one script which gives some output Have to arrange them in a table format in excel Attach the excel and send it through mail ...
3
votes
4answers
346 views

Run a script on multiple shells?

I have two servers one AIX with default shell ksh, the other RHEL with default shell bash. I have a script that is mounted on both that will run similar commands but for either AIX or Linux. This ...
0
votes
1answer
25 views

How do I add text to an output file?

I have a script for doing whois lookups: #!/bin/bash for domain in `cat /Users/jason/Desktop/letters.txt `; do echo $domain >> /Users/jason/Desktop/whois-results.txt whois $domain | grep ...
2
votes
2answers
404 views

Want a seperate file to store mysql username, password, and database name

I have as script that dumps a mysql database, and compresses the file. What I want to do is have another (edit) file which can change the username, password and database name. Then somehow connecting ...
2
votes
1answer
50 views

What is the most portable syntax for `if` statements?

(NOTE: There is a very similar question, asked yesterday oddly enough, but it doesn't cover the main syntaxes I'm concerned with. If I were to update the other question to include them it might ...
0
votes
2answers
27 views

Grep matching cell of the csv file and index of that row

I have csv file and I want to see numbers that start with 0.99 and their row's index which is the first cell of that row. This is what I have so far: cat fil.csv | grep '0\\.99'| tee > (cut -d, ...
1
vote
1answer
87 views

sed: -e expression #1, char 4: unknown command:

Could someone tell me what does this reply mean ? sed: -e expression #1, char 4: unknown command: ` ' I get it when I use : sed -n "$num"p $javaFile >> ~/Desktop/$1_sql.txt for i in `seq 5 ...
0
votes
1answer
908 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
3answers
3k views

sed - how to replace a single quote?

This works fine: sed -i 's# @driver.find_element(:xpath, "//a\[contains(@href,##' temp_spec.rb against a source of @driver.find_element(:xpath, "//a[contains(@href,'change_district')]").click ...
1
vote
1answer
770 views

bash script select menu

I've many notes gleaned from the web and have written bash scripts to manage them. I've some scripts working that depend on select to make menus. Question: in a nested menu context, is it possible ...
2
votes
1answer
40 views

Sorting image files based on whether the content is picture or graphics: updating an older solution?

Someone wanted to sort files in a directory according to whether the files are pictures(camera) vs. design graphics. On Stackoverflow, there is an older solution/proof-of-concept involving the ...
0
votes
1answer
21 views

How can you get ping to print human readable timestamps?

Ping can print you a timestamp on every line but its in unix date format :( ping -D localhost PING localhost.localdomain (127.0.0.1) 56(84) bytes of data. [1415629479.482938] 64 bytes from ...
0
votes
1answer
718 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 ...
2
votes
2answers
33 views

Match missing values in text files

Referring to this question : Finding missing value in text file i have 2 files containing below data example Name Feature Marry Lecturer Marry Student Marry ...
2
votes
2answers
6k views

Use awk to split line into array and use that array's values in calling shell

I am trying to use awk inside a bash script and do a rather common task: iterate well structured file lines and split them by a delimiter into an array. Here is a sample from the file: ...
2
votes
2answers
3k 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, ...
0
votes
1answer
395 views

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

How can I execute this grep command in TCL? grep '[A-Z][A-Z][A-Z]\-[0-9][0-9][0-9]' file1 > file2
3
votes
2answers
77 views

Finding missing value in text file

I have a text file with following data. Name Feature Marry Lecturer Marry Student Marry Leader Bob Lecturer Bob Student ...
2
votes
1answer
28 views

Error passing variable from bash to php

I have the following files: vars.txt C=1234567890 Ascript.php #!/usr/bin/php <?php var $C="$argv[1]"; echo "\n $C \n"; $con = mysql_connect('localhost','root','123') or die ("No connected"); ...
1
vote
1answer
92 views

Nmap script execution to detect heartbleed is failing

Wanting to setup Nmap on my Ubuntu 14.04 LTS system to detect HeartBleed vulnerability. I followed the instructions here: ...
0
votes
3answers
42 views

Reduce length of specific column in delimited text file

I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited. Input: file1.txt column1 column2 column3 ...
0
votes
1answer
23 views

running script with -o argument pointing to mount point of sd-card

I was trying to install Angstrom Linux on Colibri T_30 board---but I am stuck at one point where it specifies that run update.sh script with optional -o argument pointing to mount point of ...
1
vote
1answer
21 views

Running for loop with two variables? [duplicate]

How can I run for loop with two variables or in other words is it acceptable to do that? I will clarify my question by the following example: I have a list of letters included in a text file ...
3
votes
1answer
3k views

script to automate scp in network

I have a network full of Linux machines. In this network, I have a user as user1 with the password as password in all the machines. I have the following script to put files in the home directory of ...
2
votes
5answers
142 views

Re-order text on each line in a file

I'm processing a log file and I need reorder each line (not sort). The log file looks like this: 11-06-2014 - 10:49:06PM lat = 41.858657; lon = -91.345142 11-06-2014 - 10:49:49PM lat = ...
1
vote
0answers
26 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 ...
2
votes
4answers
75 views

How to display the IP address of the default Interface with Internet connection?

I need to create a script that outputs the internal IP address, that is configured as the default Interface.