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)

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
1answer
27 views

How to change date format and position in find output

Sorry if this a basic question. Say i have the following command. It's set to display a list of the last 20 files modified on my drive with the paths included. find -type f -printf '%TY-%Tm-%Td %TT ...
-2
votes
0answers
11 views

When to use a script, alias, or function [duplicate]

How do I know if a task I do regularly should be simplified with a script, alias, or function? Is there any advantage to one over the other?
-3
votes
3answers
54 views

How to list filenames within a folder based on a pattern supplied?

I'm trying to find a command that will list all files in a folder containing a keyword that is inputted. I've tried grep -l but it will not list anything
-4
votes
0answers
23 views

shell script to safely delete files by moving them to the trash can [duplicate]

The script can safely deletes a file by moving the it into the trash can, which is a directory used to hold deleted objects. The directory can be specified by the variable TRASH. If this variable is ...
3
votes
1answer
28 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 | ...
1
vote
2answers
32 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 ...
2
votes
2answers
52 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 ...
0
votes
1answer
43 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
1answer
43 views

Output a colon delimited file to another file [closed]

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 ...
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 ...
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? [closed]

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 ...
-3
votes
1answer
32 views

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

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 ...
11
votes
3answers
730 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 ...
1
vote
2answers
39 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 ...
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
50 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 ...
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 ...
0
votes
2answers
61 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 ...
0
votes
1answer
42 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: ...
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 ...
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 ...
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 ...
0
votes
2answers
23 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?
1
vote
2answers
61 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 ...
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 ...
-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 ...
0
votes
1answer
24 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 ...
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?
-7
votes
3answers
62 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
37 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 ...
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
3answers
64 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 ...
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
5answers
99 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 ...
1
vote
1answer
49 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 ...
-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 ...
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")" >> ...
0
votes
1answer
23 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
64 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 ...
3
votes
2answers
55 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 ...
-5
votes
1answer
60 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
28 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 ...
4
votes
6answers
185 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 ...
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: ...
5
votes
3answers
554 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 ...
2
votes
2answers
84 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 ...