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

learn more… | top users | synonyms (1)

2
votes
0answers
30 views

tcsh: how can we display the body of a foreach loop in history

I see that history doesn't display the body of loops. Is there a way to show them? san: cd /tmp/test san: touch abc san: touch def san: ls abc def san: foreach file ( `ls` ) foreach? echo "File is ...
2
votes
0answers
53 views

Mount USB-Device (Printer) per Script on Ubuntu 14.04 Virtual Box 4.33

We have ubuntu 14.04 with Windows7 on the Virtual Box 4.33 running. As the USB-Printer is mounted at the host or the guest and there seems to be no solution to make it on both available, now my ...
2
votes
0answers
153 views

udev rule script “xinput --list” differs in terminal versus log

I'm trying to automate a Huion tablet calibration without much success. I have this output from xinput --list in a normal terminal: ⎡ Virtual core pointer id=2 [master ...
2
votes
0answers
67 views

Unable to connect to Amazon EC2 without using PPK file

I have a build job which runs on Hudson and synchronizes content from an Amazon AWS server. This is written in shell I have a PPK file given to me which can establish the connectivity Here is the ...
1
vote
0answers
28 views

How to find files modified in last 24 hr but do not find from hidden directories and sum them

I have following command to find files modified in last 24 hr and sum all of them. #!/bin/bash find /mnt/naspath -mtime 0 -print0 | du --files0-from=- -hc | tail -n1 >> /tmp/size.log exit 0 ...
1
vote
0answers
50 views

Get filename from a wget --content-disposition

Inside of a bash script I am dynamically downloading a file and so I use wget --content-disposition to ensure the file names are correct, but how would I go about retrieving the name of the file wget ...
1
vote
0answers
415 views

Can ffmpeg be paused while recording, and then resume?

I want to record an FM radio station that provides an internet stream. I've worked out the command to record this, and I'm happy with the results. However, once in awhile I will start the command and ...
1
vote
0answers
68 views

Want to send automatic mails from email server, That To addres has to read from email that i received.?

I want to send multiple mail automatically. I will receive mail as FROM: abc@domain1.com TO: 123@domain2.com BODY: mail contains (username@domain3.com) What I want to is take the ...
1
vote
0answers
78 views

Check for a failed copy with scp

Is it possible in my code to verify if the file is well copied or not ? ssh -t root@$machine -x "sshpass -p 'ubuntu' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /home/MyFile.txt ...
1
vote
0answers
27 views

Grep from Log & Calculate then alert

I have a log file, which has the below lines in it. I need a bash script, which takes the values in Bold (4092.1M / 20.1G) & do the math & then alert from Zabbix [Eden: ...
1
vote
0answers
24 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
0answers
151 views

Chrome OS sudo startunity app

I am running crouton unity on a Samsung chrome-book. How do i automate a shell script to start unity into a chrome OS app that I can place on the chrome shelf next to the other chrome apps? i want ...
1
vote
0answers
108 views

allowing timeouts for commands that have no timeout option, where `IFS=$'\n'`

In the lines below, which I added to my copy of Apple's sysdiagnose script: wherever a timeout is already scripted, it is effective I must add timeouts in two areas, but I don't know how to do so. ...
1
vote
0answers
255 views

Run program on kde logout

I have created a backup script and I want to run it in a terminal window (to view the progress) when I logout from kde. I used the autostart feature and that works but I'm unable to show a terminal ...
1
vote
0answers
37 views

Scripting the way firefox starts

In Windows 7, is there any way to script the websites that are opened whenever I open Firefox based on certain criteria? For example, if it's Thursday, load a certain website as my homepage, but only ...
1
vote
0answers
1k views

Macintosh OS X Logout Script

I am working on a project where I need to implement a logout script on some Macintosh computers. I have read the following Create a logoff script/task for Mac OS X article and found that while it is ...
0
votes
0answers
17 views

Emacs: suppress indent after && in shell-script-mode

In shell-script-mode, when a line ends in &&, Emacs will indent the following line. Is there a way to switch that off? (I am concatenating most of my statements with &&. This gives ...
0
votes
0answers
17 views

Duration time between cycles in a log file

My apologies if this is too basic, but I have a log with this kind of information: Mai 5 12:34:00 xoengine XO[1287]: [Xo|xoengineMain.cpp:122|0xb88ec60] starting xoengine 4.0.1.2 (x86) from ...
0
votes
0answers
17 views

Sed command to replace NUL character in file

I am using the command sed -i 's/\o000//g' filename or sed -i 's/\x0//g' filename to remove the NUL character but the command works fine in DEV environment but doesnt work in UAT. OS and sed version ...
0
votes
0answers
12 views

fetch required column with delimiter from files in shell script

I am storing output of pig file in a directory Which contains lines with multiple columns separated by delimiter “ \u0001” Now in shell script I want to fetch 7th column field from the output I ...
0
votes
0answers
17 views

Shell Scripting - Mac - Emailing

I'm just messing around with shell scripting after doing some in the past, and I have figured out how to Email myself from writing a script by using: mail -s 'Backup status' ...
0
votes
0answers
22 views

How can I disable/enable multiple hardware components with a single command?

I am a web developer/designer during the day, but at night I play DJ gigs. For music, I need several hardware components disabled. Then, after the gig, I reenable all of the hardware. Each of these ...
0
votes
0answers
9 views

Triplicate entries of a column

I have a data column with over 2000 entries... MV1 BNV CMG IKN ... ... I want to triplicate each entry in the column format. Result should be; MV1 MV1 MV1 ...
0
votes
0answers
50 views

replacing special characters without using escape sequence in unix file

I am trying to replace a string with special characters like " &,*,@" etc. This should be done without using escape sequence. I am using sed but it is not working without escape sequence. I am in ...
0
votes
0answers
30 views

I want to run a script that will disable my touchpad

I want run a script that will disable my touchpad and it will run every minute. 1. My script is: if [ `lsusb | wc -w` == '76' ] then `/usr/bin/xinput set-prop 16 "Device Enabled" 0` else ...
0
votes
0answers
25 views

how does ' =~ ' functions in shell scripting?

I want to understand what is the use of =~ regex function? Both the below mention scripts does the same thing so under what condition do we use [[ and ~. 1. x="abc" y="abc" [[ $x =~ $y ]] ...
0
votes
0answers
10 views

Reloading tab completion in postinst script

I'm distributing a .deb that (among other things) installs a file to /etc/bash_completion.d/example for tab completion. The file gets installed correctly, but the tab completion is not immediately ...
0
votes
0answers
52 views

Linux: Delete all but x files?

I have a series of files with different IDs: File_ID1_1 File_ID1_2 File_ID1_3 File_ID1_4 File_ID1_5 File_ID1_6 File_ID2_1 File_ID2_2 File_ID3_1 File_ID3_2 File_ID3_3 For every ID there is a defined ...
0
votes
0answers
59 views

Removing directories using bash script

I have a bash script which I want to delete 5-day-old directories with a name format such as 01-Aug-2015: find /usr/backup/mysql/$date -type d -mtime +5 -exec rm -rf {} \; This is not working for ...
0
votes
0answers
70 views

MySQL Workbench - Add Connection from command-line

I'm writing a shell script to auto-provision a development environment for new employees. The OS is Linux Mint 17 (Qiana) and the idea is to run the script and at the end have a fully configured ...
0
votes
0answers
97 views

Script to open multiple gnome-terminal tabs, each running their own command?

I am currently developing a plugin for Minecraft. My setup consists of five terminal tabs, which I have to recreate every time I log in. I need to cd to the particular directory, then run the ...
0
votes
0answers
21 views

Where to put a configuration file with password/acess token on OSX?

Where to put a configuration file with password/acess token on OSX without versioning on a dotfiles public? Example dotfiles: https://github.com/alexandref93/dotfiles ...
0
votes
0answers
58 views

Copy from SFTP to local host using Username/ privatekey.ppk using powershell

would you please help me , i need script that copy files from FTP server to local host using only Username and .ppk as a private key , i don't have password. is it possible to do that. Please ...
0
votes
0answers
211 views

OS X Automator to create a set of folders based on list in a text file

I'm a Terminal and Automator novice. I have found a terminal command that allows me to create a bunch of folders from a text file formatted as following: "Folder Name" "folder Name Two" "Another ...
0
votes
0answers
43 views

Execute commnad after server started in other pane with tmuxifier or tmux

I have a window with several panes where I execute commands to start the servers. I want to be able to execute commands after a server is running. To run commands in the same pane is not possible ...
0
votes
0answers
36 views

shell script to generate a log file for VM Backups

we are using PHD virtual backup to trigger backups for VMs and now i want to generate a report of all VMs in a file consisting of VM Name, Date and Backup Time and mail it to my ID at particular ...
0
votes
0answers
27 views

script not running from remote machine

I have a shell script file in one machine(say jupiter.prashanta.com) which basically runs vlc as user. When I run this file ./runVLC.sh , it runs fine. The content of runVLC.sh is #!/bin/sh su user ...
0
votes
0answers
32 views

Staret managed server using Jenkins

I am trying to start web-logic managed server from Linux system. for that I have one shell script start_wls_managed4_btwnpmd01.sh with following code. ...
0
votes
0answers
155 views

Don't interrupt script in sh (“try-finally” for sh scripts)

I'm trying to make a simple script to wrap a command in such a way that it runs with a swapped screen. The main target is top but I wanted it to be a general wrapper. I got it running fine with bash ...
0
votes
0answers
135 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
0answers
24 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 ...
0
votes
0answers
79 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
0answers
28 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
0answers
104 views

Tools to create a 'GitHub' style index page for files/folder on a fileserver?

My workplace doesn't have a document management system. People just throw files on a shared fileserver, where search doesn't really work. Trying to find information/files for a particular project by ...
0
votes
0answers
58 views

Implement Roll-backing in bash script

I have implemented an Ubuntu package in which bash scripts are using. I followed these for making packages in Ubuntu. ...
0
votes
0answers
73 views

Energy volume calculation script

Hi I want to write a shell script for energy and volume calculations for different lattice constants. For convergence of energy,using siesta. can anyone help I tried this work manually but now want to ...
0
votes
0answers
699 views

Rotate Outgoing Ip in Postfix, script not working

I've found what it seems to be a nice piece of code meant to rotate postfix IP but I really can't get it to work. when I run it I get this error: rotate_postfix_ip.sh: 2: Syntax error: "(" unexpected ...
0
votes
0answers
26 views

Different behavior from ubuntu server and ubuntu client on windows

#!/bin/bash # Reading cat /home/radiare/Desktop/first.txt | while read LINE do echo $LINE if [ "$LINE" == "false" ]; then echo "Inside first loop" break fi done echo "second file read started" cat ...
0
votes
0answers
89 views

scheduling various things and balancing bandwidth while using torrent and uploading

I have approximately 200 files to be downloaded via BitTorrent, these files can be from 200mb to 4.8 GB on the same time I want to take backup of some already existing pdfs in my home directory, ...
0
votes
0answers
283 views

Workaround for ENOTTY while running a c process from script?

What's the issue? Getting a ENOTTY error on a function call tcgetattr() when the process is invoked from a script. The error comes only when ran from the script. If it is run from an interactive ...