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 (2)

0
votes
0answers
6 views

Run this PHP file via Cron Job

Here is the script: <?php //Create back files? define('CREATE_BACKUPS', FALSE); if (!is_dir($argv[1])) { echo "You must enter a valid path such as /home/apresv/public_html or ...
3
votes
2answers
82 views

echo $PATH shows path to python scripts, but they cannot be executed

I am new to using the shell, and wanted to create a directory in $HOME where I can put all my python scripts, set a path to that directory, so that I can go into any folder on my Mac and execute those ...
0
votes
2answers
25 views

Help creating script to move files based on date or filename

I have an FTP process that is constantly putting files into a directory. The date created is part of the filename in a format like this: YYYY-MM-DD-HH-MM-SS-xxxxxxxxxx.wav I would like to move the ...
1
vote
1answer
16 views

How do I script deluge to get information about torrents?

Dealing with a lot of torrents is not always convenient when using GUI. I tried deluge-console info, but that didn't give all the info I wanted. So, to make it clear, what I need is a script, that ...
0
votes
1answer
24 views

Reading file using shell script, format of the line has changed

I am reading a file using the following code: displayLine(){ echo $line } filename="SampleFile" while read line do displayLine $line done < "$filename" The format of the file that I am ...
0
votes
1answer
48 views

cp doesn't work in a script but does from the command line

I have this script for automating a simple process where I scan a number into the command line, grep that number out of a catalog file which gives me a path, and then copy the DVD which the above ...
0
votes
0answers
33 views

How to execute a command after ssh login via batch file

I want to execute a set of commands at once I login to a ssh session everytime via a batch file. Eg: start putty.lnk -load "session" -ssh username -pw password -m <commands> Here I am using ...
2
votes
1answer
52 views

What Command Line tools to connect from Unix to remote Windows?

I need to make some scripts for connecting from a Unix server to several Windows stations for automating file transfers. GUI is not needed and I can't install any additional software into Windows ...
0
votes
0answers
18 views

Script acting as textfile, possible? [duplicate]

A program I'm running has a -logFile option. The file I set as a logfile is filling up quite rapidly, and I only need about half of what's actually in it. Is it at all possible to: have a script ...
0
votes
2answers
47 views

Command to skip process if file exists

I have been using a for loop to run a pipeline for multiple files but unfortunately the terminal froze halfway. I would like to run the pipeline again but because of time I would like to skip the ...
0
votes
1answer
16 views

Help designing an 'extract - store - feed' workflow

Working with a large volume of files, I would like to automate the process of storing stdout info as a variable that I can feed into as an input for my next process. Specifically, when I put... ...
0
votes
1answer
23 views

How can I create a single shorcut to open a set of programs?

Currently, I have a set of shorcuts to open several applications. I use xbindkeys to do so. I have something like this: Super + u -> sublime Super + e -> pcmanfm Super + s -> skype Super + x -> ...
0
votes
0answers
26 views

Can a Linux server that authenticates against an Active Directory accept public/private keys for passwordless login?

I have a Linux server that authenticates users against an Active Directory. Now interactive logins require username and password and automatic login requires a keytab (Kerberos) for passwordless ...
-1
votes
2answers
43 views

how to login a user using shell script [closed]

In my computer i have two user(tiger,jenk) now i want to create a shell script for login user "jenk" from user "tiger" i m try this code [tiger@pagaltiger mytask]$ echo -e "IncorrectPassword\n" | ...
1
vote
2answers
39 views

How to remove prefixes and suffixes from filenames in a given directory?

I have many files with the same prefix and the same suffix. I want to remove both from filenames. Both contain spaces. So foo bar XXX doo par.jpg, foo bar YY YY doo par.jpg would become XXX.jpg and ...
0
votes
1answer
30 views

Kill command also kills other process

I have a very simple script, let's call it foo.sh. It's this: #!/bin/sh sxhkd & panel & where panel is a script (I won't post it here because it's very long and I don't think it would be ...
1
vote
2answers
58 views

Stop bash script with any key

I'm writing a custom gnome-terminal profile which I want to stop with any key I choose. After pressing the key, my intention is to complete all my commands at that moment and start su. I've tried ...
0
votes
1answer
22 views

BASH script presenting IF syntax error

for k in {794..800} if [ -f "vesta_$k.xyz" ] then do mkdir $k mv vesta_$k.xyz $k/vesta.xyz cd $k/ <<COMMANDS>> cd .. ...
-1
votes
1answer
19 views

Search for and kill process in script

I have written a script to stop a Tomcat instance, remove the .war file and application directory, copy a new .war file from a NFS mount to the webapps directory, and then restart the Tomcat instance. ...
1
vote
2answers
35 views

legality of creating a variable for a file location

adapter= /Volumes/My\ Passport/Documents/adapters.fa Can I create this variable so that I can just refer to adapter for the exact file (and its location)?
0
votes
1answer
25 views

Rss in full text

I am looking for a way to extract the full text from an html file in the command line. The purpose of this is to make a blocklet for my i3 status bar. I have found some site with names like "Full ...
2
votes
2answers
26 views

Parameter expansion question

I have 2 files each in user/admin/1/2/[a-c] subdirectories. The files are preQC_1.txt and preQC_2.txt - both of which will be inputs in my tool. I use "${f##*/}" for preQC_1.txt in my for loop for ...
2
votes
3answers
200 views

awk : parse and write to another file

I have records in XML file like below. I need to search for <keyword>SEARCH</keyword> and if present then I need to take the entire record and write to another file.(starting from ...
0
votes
4answers
39 views

Rename files randomly but without repetition

Suppose i have a folder with a lot of file names some very strange and nonsense I want to rename it like File-1 File-2 File-3 .. I have tried this(echo is for tryng) for name in *; do echo mv ...
1
vote
1answer
44 views

generate file names in loop [closed]

DISCLAIMER: I am using Mac OSX. The bash script is in a different directory from the files that require processing. From here my struggle begins… HELP 1: I have multiple files each housed in a ...
0
votes
0answers
43 views

Unix scripting : Writing to another file with “:” is failing

I have below record (and many other such records) in one file 9460 xyz abc (lmn):1027739543798. Taxpayer's identification number (INN): 123. For all IIB. 2016/02/03 I need to search ...
3
votes
2answers
32 views

SSH Connection - Interact with ongoing process

If i open a Terminal window on my desktop and start a job on it and go to work in the morning. Is there a way to connect to the desktop with SSH and interact with the ongoing process in the Terminal ...
0
votes
4answers
53 views

Find files using shell script

I have the below script which looks for the file in the current directory and evaluates to true if the file exists in the directory and evaluates to false if it does not #!/bin/bash printf "\n Please ...
2
votes
2answers
38 views

Renaming a file the moment it appears in a folder

Here's the context : on a samba server, I have some folders (that we'll call A,B,C,D ) which are supposed to receive files from a network scanner. The scanner renders a PDF file named like this : ...
1
vote
1answer
25 views

Use xvfb to automate X program

I originally posted this question here, but upon second thoughts I decided here was a better place for this. I sadly have to use this proprietary program that bundles a camera driver. I want to ...
4
votes
2answers
196 views

shell script to make directories, subdirectories and files following a pattern

Is it possible to create a script that will create the following structure after running it: /test/1/1 -> A /test/1/2 -> B /test/1/3 -> C /test/1/4 -> D /test/1/5 -> E /test/1/6 -> ...
-4
votes
2answers
72 views

Create Directories and Subdirectories as Another User [closed]

I am trying to create directories and subdirectories as another user, from inside a shell script. The problem is, I am running the script as root, so the directory is being created with root ...
-1
votes
0answers
41 views

dump unstructured content of file to a csv or excel sheet [duplicate]

I believe it is not duplicate of other thread which we discussed in past. The reason being is: Here we have some rows (Virtual Disk, Physical Disk, device and shareddisk) which are repeating several ...
1
vote
1answer
44 views

script Multiple Commands

I have a PHP script I'm running from Cron. I want to save its output to file, but also want to save the shell output to a different file. Ideally, I'd like to have this in one line. As such, I tried ...
-1
votes
5answers
80 views

Bash script to insert letter based files into directories [closed]

I'll start by saying I'm a complete novice to this. So basically, what I need to do is create a script that makes 15 directories (named from 1 to 15) and inside each directory I have to have a letter ...
0
votes
2answers
37 views

Bash Script execute command as user

I'm just wondering if it's possible to execute a command inside a bash script as a specified user and supply the password in one string. At the moment I have COMMAND="${DIRECTORY}/script.sh" su -c ...
0
votes
2answers
47 views

Correct way to set PERMANENT environment variables from script

I want to do a very simple install process for my app framework. I've got everything working, but I want to set two environment variables. I want to update the PATH and also set a HOME variable. I ...
1
vote
2answers
30 views

Using getline with NR in awk

I have a bash script which calls a awk script to print each line from the file name_list.txt #!/bin/bash awk -f parse_list.awk name_list.txt In the awk script, I am using getline with NR to print ...
1
vote
2answers
49 views

How can I save password,when copy a file using SCP?

I am new in here. I am facing problem when I pull a file from another machine to my machine using SCP. File is successfully transferred but each time it asks for password. I want to run this SCP ...
3
votes
3answers
78 views

how to monitor a unix directory and if any new file in directory it will be copied to another directory

I want to monitor a unix(Solaris 10) directory and if there is any new file i want to copy immediately. Tried: I have shown inotifywait and incron package in linux for it but i don't know whether it ...
1
vote
1answer
51 views

How do I find files older than 1 days using mtime? [duplicate]

I'm trying to remove all files more than 1 days old.Before I execute a script to remove the files,I try to find the files using mtime. however, I face same problem with my command- My Current date is ...
3
votes
2answers
65 views

What does “if echo $line | grep -F = &>/dev/null” do?

I'm not sure what the following line does in a bash script: if echo $line | grep -F = &>/dev/null then ... I know &>/dev/null is short for >/dev/null 2>&1, I'm not sure, ...
0
votes
2answers
31 views

How to count how many files belong to each user/group combination?

How to count how many files belong to each user/group combination? I need to do this for each user/group combination that exists, in each of the directory trees /etc, /usr, and /var.
0
votes
1answer
13 views

linefeed in bash script - to email

I am doing printf to a logfile and having that logfile send through mailx, however, it seems that the linefeed "\n" are not recognised or captured in the mail. Snippet of script as below (notice the ...
0
votes
0answers
51 views

Shell scripts for proof reading

I am using below mentioned script present at link to check my writing. But, while running the scripts some syntax errors are shown up. I am not able to correct the same. Haroons-MacBook:democheck ...
0
votes
2answers
49 views

How can I filter out current directory ('.') in bash?

I'm currently trying to write a little script to convert all the flac files to mp3 files. However, I ran into a bit of a problem when trying to set up recursion down into all my music folders - the ...
-2
votes
2answers
52 views

How to use this script [closed]

#!\bin\bash for i in `seq 1 1000`; do wget -q -O quotes http://www.quotedb.com/quote/quote.php?action=random_quote; cat quotes>>final.txt; done I got this script from one website but I don't ...
0
votes
2answers
67 views

Script for ssh automatic login to a specific port

So currently, the "traditional" way to connect through SSH is the following one: ssh USERNAME@HOST -p PORT I would like to create a script in which I will include all the appropriate information ...
1
vote
0answers
44 views

Bold and Underline using echo with email

I am using a script that emails me a particular status report. The script sends me the contents of several files. I am using echo to provide a heading in the email that is used to differentiate ...
0
votes
0answers
10 views

LUA Script syntax

I wrote under suggestion a LUA script clearDS() addDS(".", "IN DNSKEY 257 3 8 ...