A shell script is a script written for the shell, or command line interpreter, of an operating system.

learn more… | top users | synonyms (1)

0
votes
1answer
9 views

How to determine if a screen is running jobs without attaching to it?

I wrote a zsh script that launches many screen sessions and runs a different command in each of them. When the script is executed there are 72 screens in total, so checking if a job is finished or not ...
0
votes
1answer
8 views

Curl can't follow “This page should automatically redirect”

I'm attempting to automate a login for the a course webpage I have to check this semester. I know that the POST request I am making is being done correctly because I get to the intermediate redirect ...
0
votes
1answer
17 views

Creating a shell script to compress files using Cygwin

I've got a minor project wherein I'm to create a few shell scripts in Windows and run them through Cygwin for Linux files. At least that's how it was described to me. Any suggestions would be great.
0
votes
0answers
29 views

ksh script using if break statements

I have a script file that has the server details like set -A SERVERGRPS SERVERS_CA SERVERS_NY set -A CA ca126 ca546 ca 642 set -A NY ny112 ny113 ny114 now I have to write a another script which ...
0
votes
1answer
27 views

Linux bash iterating and Break

I have two server groups SERVERS_CA AND SERVERS_NY. I will have a array something like SERVERGROUP=(CA NY) CA and NY will have set of servers in arrays like CA=(ca126 ca546 ca 642) NY=(ny112 ny113 ...
0
votes
1answer
24 views

Monitor process start time, end time using shell script

I am working on project in which we execute shell script which invokes the Node process and further processing happens. I want to design a script which should log the start time, termination time of ...
0
votes
0answers
16 views

Can I Query a Pdf Reader If It's On The Last Page?

I'm writing a wrapper shell-script to do the following: Searches a directory for .pdf/.djv files. makes an ordered "playlist" of files Opens 1st file in a pdf reader. Automatically change to the ...
3
votes
1answer
20 views

Bash: optionally passing arguments to a command

I'm trying to add arguments to a command call depend on another variable. Please look at the shell scripting code: curl \ $([ -z "${title}" ] || echo --data-urlencode title=${title}) \ ...
0
votes
1answer
16 views

Start Chrome by command line, but adding some arguments to make it login into your Google account automatically

Is there a way to start Chrome calling it from the command line (using Linux), but providing it some argument to make it login into some Google account automatically? I'm looking for something like ...
1
vote
2answers
18 views

Controlling Multiple Instances of VLC etc. by a “Unified” Hotkey Command

I wish to invite suggestions regarding if and how is the following achievable: controlling multiple instances of a media player (say VLC) by one "unified" hot-key command. eg. Pressing spacebar would ...
0
votes
1answer
32 views

Execute vim commands from a script

SO I've created a script that opens all of the files in a particular directory in vim in separate terminal tabs for me: #!/usr/bin/perl use v5.14; my $wd = '/home/luke/Pokemon-Battle-Simulator'; ...
1
vote
0answers
15 views

“Autoscroll” Pdfs one by one from a “play-list”/directory

Is there a way to achieve this: open multiple .pdf from a "playlist"/given directory one by one in the same window, with auto-scrolling enabled? (Explanation: 1st pdf opens- autoscrolls to the end- ...
1
vote
1answer
100 views

How to restore “.sh” association in bash?

For some unknown reason I have a Debian 7 VM where .sh files that don't have a shebang line (#!/bin/sh) are no longer associated/executed by bash, ie. under bash, with "test.sh" an executable shell ...
0
votes
1answer
26 views

Dynamically discover new IP address of device upon new network

I carry my phone and laptop with me everywhere, and I have many software solutions that communicate through Wi-Fi. (For example, I can play/stop/pause the music on my laptop using my cell phone). ...
0
votes
4answers
45 views

Kill multiple processes by name instead of pid

I have a job that spins up 2-5 copies of a command on Ubuntu Server 14.04. I'm trying to figure out the simplest (i.e. single command-line instead of a script if possible) to kill all of them. The ...
0
votes
0answers
9 views

Automator shell script that triggers opening gui apps

So I have a service, I want it to be running on startup. I thought I could use Automator. The problem is - that thing may need to open gui app, and that of course doesn't work. I'm running Vrome ...
0
votes
1answer
30 views

Memory usage of a process in a shell script

I want to find out the memory usage of a process in a shell script.I tried to use this piece of code : while[process] do if [ -e /proc/$pidno/statm ]; then m=`awk '{OFS="\t";print ...
1
vote
2answers
28 views

What's the Ideal Way to Swap Entries in the $PATH environment variable?

In Linux and/or Mac OSX, what is the best way to automate moving an entry in the $PATH environment variable to the front of the value like this: /foo/bar:/one/two/three:/opt/local/bin:/home/user/bin ...
1
vote
1answer
27 views

Find and run script from another directory

I have a script, say data.sh, which takes many data files in the same directory and process them. I have many directories with different files but I have the same script in all. I can routinely go to ...
0
votes
0answers
22 views

how to detect availability of GUI

For Linux: I have a text mode installation (bash) script and a graphical mode setup program (a Free Pascal binary). I'd like to run the graphical setup when a GUI is available. How do I detect which ...
1
vote
2answers
75 views

What does \; mean in a script?

What does \; mean in the following command? I’m also not sure what {} means. Is \; really necessary? find ./ -name file_1 -exec cp {} ./ \;
0
votes
0answers
27 views

Rsync and find filter

I'm trying to use rsync in combination with find to restrict the number of files to copy. My code looks like this: for NODE in $NODES; do echo Processing $NODE ........ for LOGDIR in ...
0
votes
0answers
55 views

Windows 8.1 does not remember credentials of network location

I have a bunch of computers running Windows 8,1 connected by LAN to one central server that runs Server 2012 R2. I have all my scripts stored on the server, so to be able to run them from the other ...
2
votes
1answer
38 views

Is this a bash-specific method of calling a script: VARIABLE=value bash somescript

I have worked all my life in HPUX/ksh shell, so bash these days seems to be throwing new ways of doing many things (many of which don't seem to be POSIX compliant - for example 'mkdir -p ...
0
votes
0answers
22 views

How to manualy spawn a client in a specific tag in Awesome?

I already have automatic tag assignation for clients using rules, but sometimes I need to spawn a client in a specific tag. For example, I usualy want my browser (dwb) in tag 2 using the following ...
0
votes
1answer
47 views

init.d control script for virtualbox VM

I have an Ubuntu server on which a Virtualbox virtual machine needs to be running at all times. The VMs are administered by a specific user VMAdmin which has no admin privileges. I need to create a ...
2
votes
1answer
52 views

Using bash script to select/view only specific data from logfile

My NAS creates a logfile in the format below: <30>1 2014-07-21T05:02:10+02:00 ABC-NAS qlogd 6432 - - qlogd[6432]: event log: Users: Glacier, Source IP: 127.0.0.1, Computer name: localhost, ...
-1
votes
2answers
23 views

trying to login automatically into a server using sudo ssh cmd in script [closed]

I am new to Shell scripting. I want to login to a server using a script. The normal command I use is --> sudo ssh . when i tried putting this into a txt format file and tried running, it throw an ...
-2
votes
1answer
36 views

how to run command in another terminal in Linux script

In Linux shell script I have to run few commands under another user but I am enable to. Please advice some suggestions. $ jumpto -T -u ... after this command it enters in another terminal and I ...
-1
votes
1answer
38 views

how to retrieve following error when i execute shell script

I have one script to log into remote server.But i tried to Execute the script some error occur. Logs: My script: #!/bin/bash S1=$(ssh -t selvam-odc-shell1 "users | wc -w ") S2=$(ssh -t ...
1
vote
1answer
47 views

Batch convert txt file encoding

I have about 700 files that were the results of a closed caption software process. I can open the files on my PC or Mac in a GUI, but when I open it on the server with nano, I get this: ...
0
votes
0answers
24 views

Distributing master key in hadoop

For the master node passwordless-ly ssh into the slaves, the master needs to distribute its ssh keys to the slaves. Copying keys using ssh-copy-id asks for the user password. If there are hundreds of ...
1
vote
1answer
39 views

Sending emails from script - empty email

I have some script that sending email to me from server: #!/bin/bash DWATYG=$(date +%d.%m.%Y -d '16 days ago') RAPORT=$(ausearch -i -k RBS -ts $DWATYG) echo "$RAPORT" | mutt -s "Raport RBS" ...
0
votes
0answers
52 views

Wrong exit status from expect script

I developed the TELNET_TEST.expect (expect script ) in order to test TELENT connection on remote machine this script perform telnet on target machine wait for login and send password and make exit ...
0
votes
0answers
27 views

Bash script for repeated execution of benchmark

I'm working on a project involved with cloud instance performance. Currently running UnixBench on EC2 instances. For comparison purposes I require a benchmark to be run constantly on one instance. By ...
0
votes
1answer
27 views

writing a script to mail all users online

I am taking my first Linux class and we are writing scripts. Currently I'm trying to write a script that will look at who is online and then send them a mail This is an entry level linux class so ...
0
votes
1answer
34 views

Command in script fails with “not found” error, but runs fine on command line

I've created a minimal environment on my embedded ARM device consisting of just the Linux kernel, and with Busybox and a minimal filesystem in an initrd image. I have an inittab that runs ...
0
votes
1answer
38 views

Keep only latest two folders in the directory

I have a directory which has the following folders. Data-2014-07-10-0240 Data-2014-07-10-0340 Data-2014-07-11-1232 Data-2014-07-12-0530 Data-2014-07-13-1210 I want to keep only latest two folders ...
0
votes
0answers
13 views

Copy all files except those that are executable [duplicate]

I have a backup script that copies all the files in my programming directory to an external HDD. Right now, the output files are called program.out and my script is set to ignore them, but I would ...
0
votes
1answer
29 views

sh + how to run command and set it into parameter ( VAL )

please take look on the following commands down, ( the shell is sh ) something not clearly for me when I run - eval echo \$arr$n , I get the value a as expected so why: VAL=eval echo \$arr$n , ...
1
vote
1answer
39 views

Finding subdirectories in linux

I am trying to search through all the subdirectories in the current directory for a directory named 'jdk1.7'. I have written a statement like find -type d -name 'jdk1*' But I am not getting any ...
0
votes
2answers
53 views

List of MAC addresses for 10 machines

I need to list of MAC addresses for a 10 computers having Windows 7 installed on them. These are named in a series like training1 - training10. There IP addresses are on DHCP mode and update every ...
0
votes
0answers
21 views

I need a dynamic script for changing Host IPs depending on computer name that I can shoot over the network

Does anyone know how to make a Batch/Script, that I can modify, for looking up the host computer name and build the IP and gateway off of it. we have a simple setup of computer name refers to ...
0
votes
1answer
73 views

how to batch change date created to date modified

I have many video files ending with extensions mov, avi, mp4, and mts. I need to change their "date created" to their "date modified value" I tried using the following powerhsell script: ...
0
votes
1answer
77 views

Run a script only at shutdown (not log off or restart) on Mac OS X

Is there any way to run a script only at shutdown? I mean, only when the computer is really shutting down to off state. This script should not run when doing just a log off or restart.
0
votes
1answer
19 views

Backing up github [closed]

I have a bunch of github directories and have been using a script with the "cp" command to backup to an external USB drive. I was wondering if I should be backing up directories that I make for ...
0
votes
0answers
11 views

unable to terminate the program via using function in shell

I have two files 1.sh and 2.sh below is the code of both files. 2.sh is main file which is executing and 1.sh is used for defining the functions. 1.sh function logging_function() { STATUS=$1 ...
1
vote
2answers
95 views

How can I read out internal pdf creation/modified date with Windows PowerShell?

PDF files seem to have a separate set of file properties which contain (among others) a creation date and a modified date (see screenshot here: ...
1
vote
2answers
81 views

CURL used in shell

I am executing a shell script in which one curl command is present. I have to store the output of curl command(xml format) in a file and display the result on screen. For this to happen "tee command" ...
1
vote
1answer
62 views

How to wake-up remote IIS webserver using dd-wrt shell scripting

The problem: I have some asp.net websites hosted on IIS ( at a local hosting company). Now if nobody access them during aprox. 20 minutes, the IIS is going into sleep mode, so the first next request ...