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
0answers
27 views

A script which can be run from a flash drive and modify startup applications

So I have created a script I would like to run on computers at startup on the network I manage. Each is unique, so merging settings accross the network would be problematic. I could change each ...
3
votes
4answers
300 views

grab volume name of volumes over 85%

I want from the output below grab all the volume names that have a capacity over 85%. I know that there isn't one in ths example but lets pretend there is. :) Filesystem total ...
0
votes
2answers
136 views

Why script with /bin/bash is working, with /bin/sh not?

My friend asked me why this two simple script are not working in both shells: Test File "abc.txt": aaa 111 bbb 111 ccc 111 ddd Script #1 (a): #!/bin/sh while read -r line ; do echo ...
4
votes
1answer
67 views

How to set my Bluetooth python script on higher priority than Ubuntu's request?

I have got a Bluetooth Python Server Script on Ubuntu to connect with an incoming request from a Smartphone device. However Ubuntu's Bluetooth is getting the request before my script can react on it. ...
2
votes
1answer
53 views

Bash script to check if mdadm is installed if not install it

I am currently working on a bash script to create raid5 with 3 disks and one hotspare. I am confused of how to create a script which first check if mdadm exist, if not it will install it and name it ...
2
votes
2answers
177 views

Temperature & RAM monitoring script

I have the following script: while : do clear; echo "---------------------------RAM Load------------------------------$ free -mt >> memory.txt; free -mt; ...
-1
votes
2answers
92 views

Bash script download dynamic directories

How to download the most recent packages in deb files (all in a folder) for my platform (x86_64/i386) & distro with bash script? There is no PPA for this apps. So I'm interesting in ...
0
votes
1answer
50 views

System Monitor Script

I created a simple script written in bash to constantly monitor my system temp and RAM free. while : do clear; echo "---------------------------RAM ...
1
vote
0answers
25 views

Moving files to usb stick and virus scan

I have the task of moving a single file to 50+ usb sticks and then virus scan them with clam-AV. I have a 6 way usb hub that I can use to speed things up. I am after running a script that prompts for ...
0
votes
1answer
108 views

Network Manager dispatcher.d script error

I wrote a script in "/etc/NetworkManager/dispatcher.d" to open the Firefox preferences dialog whenever I connect to a particular network (college wifi), because I have to enable proxy. The script is ...
1
vote
1answer
103 views

Nemo Custom Action (.sh script) does not execute

I created a .sh script for simple OCR-ing of screenshots that I make with Shutter. The script looks like this (ocrFile.sh): #!/bin/bash convert $1 /tmp/output.pnm cat /tmp/output.pnm | pamstretch 4 ...
0
votes
0answers
42 views

Kubuntu: open application on specific monitor using bash script

I use two monitors and i want to write a bash script which opens applications on my second monitor (thunderbird for example). I use conky which is also on my second monitor. I want to define the size ...
1
vote
1answer
73 views

Open a terminal a run a program on it automatically when the session starts

I have a script to open a terminal and run a command on it: #!/bin/bash export DISPLAY=:0.0 /usr/bin/gnome-terminal -e '/home/me/bin/application --option a --option b --debug' However, the ...
0
votes
1answer
41 views

How to trigger a script when an external USB disk is mounted?

I need to automatically copy images off a camera when it is inserted into the USB port. I've written a script to do the copying, and I've found that, by creating a file ...
0
votes
0answers
24 views

Does anyone know how to connect to network Drives using scripts?

I've looked around, but I couldn’t find anything that worked. I'm trying to create a script that runs at startup which connects to my colleges network folder(smb://stuff/stuff). This script would ...
3
votes
3answers
82 views

How to concate strings in a bash script to use in SQL-Statement? [closed]

I would like to do the following in a bash script: read some filenames out of an file with filenames set a variable input path concat 1. and 2. use 3. in sql-statement Here my code: ...
0
votes
0answers
44 views

How can I fix this vncserver startup script?

I've been working on getting multiple remote desktops up-and-running on my new installation of Ubuntu 12.04.3 by following this guide: ...
1
vote
1answer
273 views

mysql statement in bash shell script does not work / syntax error

hope someone can help me! I do not know what's wrong with this script (Bash / Ubuntu 12.04 / Mysql / XAMPP 1.8.3). Try to read an input file with a list of csv-filenames (449-R11, 449-R12 ..) in order ...
0
votes
0answers
30 views

Notify me when a LTSP client inserts a USB

I want a script/software to notify when an USB is connected to LTSP client machines. How to show notification when a usb device is inserted? This question has an answer but for Ubuntu version <12. ...
0
votes
1answer
24 views

Removing Sys-V-Init script in favour of rc.local. Will application still shutdown correctly?

I've had to remove the /etc/init.d/crashplan script by doing update-rc.d -f crashplan remove in favour of starting the daemon using /etc/rc.local (the reason for this is that I have an encrypted home ...
0
votes
2answers
102 views

It is possible to run a Exe file in RedHat [closed]

I am new to linux. I run the batch file which will execute exe file in automated way. I need to do the same in linux. Kindly give me some idea how to use it. Thanks in advance
0
votes
1answer
56 views

Why the cron job did not fire on ubuntu 12.04?

Here is the script sqlite_backup.sh under $HOME/: #! /bin/bash now=$(date +%d) echo "Welcome to Sqlite backup script" sqlite3 /var/www/db/nbhydb.sqlite3 << EOF .timeout 20000 .backup ...
1
vote
0answers
38 views

nproc returning two values on python [closed]

I'm trying to write a script to do something that I repetitively do everyday, and that for it to be useful I need the value given by the command nproc. The problem is that nproc on bash returns my ...
0
votes
0answers
11 views

How do I write an LSB header?

I used these instructions to try to make a script run at startup. I got the error "missing LSB information. See http://wiki.debian.org/LSBInitScripts" So I did. I sort of get what's going on, but ...
0
votes
1answer
28 views

How to delete files and subdirectories by size and age?

I have a ubuntu server 12.10 which receives images from a camera by FTP, I receive the images in a directory with a fixed quote on the server and I need to delete the oldest images first, I would like ...
2
votes
2answers
46 views

Extract a date from a filename for CSH script?

I am trying to write a CSH script that will look at components of the filename to generate a date/time. The problem is, I have no idea how to extract part of a filename to use it. Here is a sample ...
0
votes
1answer
305 views

Creating and executing shell scripts to run XAMPP on double click [duplicate]

Basic Specs - Ubuntu 13.10, Gnome 3 (session fallback), Ambiance theme, Faenza icons. I recently installed XAMPP, now everytime i want to use the program i have to run the sudo /opt/lampp/lampp start ...
-2
votes
2answers
111 views

How to make a script that backup System in Ubuntu 12.04?

I need a script that when I execute it, it will backup the system to a specific folder (destination). I'd also like to exclude some files.
0
votes
1answer
28 views

run all command inside script with typing the password one time

i want to write script inside the script i will do many commands that require to be root like sudo apt-get update sudo apt-get upgrade sudo apt-get install eclipse but i want to write the password ...
0
votes
0answers
56 views

Is it ok if rc.local calls script with infinite loop? and some rc.local basics

I'm running 12.04, and I've never really messed with rc.local. First, when I source myscript.sh in rc.local, should it be /path/to/myscript.sh or sh /path/to/myscript.h or does it even matter? Can ...
1
vote
0answers
87 views

cannot execute script with sudo no password

I would like to create a batch file that will connect via ssh to my ubuntu server and run a script. My batch file works by using plink, I can see that the call to my script is ran but then I'm asked ...
2
votes
1answer
65 views

Non-deterministic behaviour in bash script for screen window opening and naming

I have the following bash script to set up a screen session with four windows from the command line in 13.10. Comments indicate what I think it ought to do. screen -dmS mysession # start screen, name ...
2
votes
1answer
99 views

Running a Process on Startup

Sorry if this is a bit of a basic question, I'm fairly inexperienced with Ubuntu and Linux in general. I am looking to upgrade an application server from JBoss EAP 5 to Jboss EAP 6, previously we ...
0
votes
1answer
92 views

Problem while running script

I am getting error while running kafka-zookeeper script. Command i tried to run the script is root > /etc/init.d/kafka-zookeeper start Problem 2014-01-22 13:05:26,683] FATAL Severe ...
0
votes
1answer
153 views

Bash script, cannote replace string in a file with escaped $ and &

I have creatd a shell script which takes a string as input. If the string contains '$' or '&', then I need to raplace those characters with '\$' and '\&'. I could done that with sed command. ...
0
votes
0answers
17 views

How to create a script to play a sound when F12 is pressed?

I would like to listen a sound when Yakuake terminal is displayed this happens pressing F12, but I would like to listen a sound at the same time. Any suggestion is more than welcome.
0
votes
4answers
78 views

.sh not running and getting no errors

I am try to create a .sh file to check to see if the server is running and if not to start it. i am not getting any echo's from this script or any fails but it is not running. can some one help me fix ...
3
votes
2answers
95 views

Add seconds to a given date in bash

I have a complete date plus hours and minutes. I would like to add a number of seconds and display the result as a date "day.month.year hour:minute". "date" doesn't seem to be able to add seconds to ...
1
vote
0answers
198 views

Tar extract error - implausibly old time stamp 1970-01-01 01:00:00 [closed]

I was create a tar script to make a backup of / directory on flash drive with exluding these folders: /lost+found /mnt /media /proc /sys /tmp Here's a fragment of script: sudo tar -zcpf ...
2
votes
1answer
133 views

Yad list columns

I need some help with Yad. This is my code: contact=$(while read line do firstname=$(echo $line | awk 'BEGIN { FS="|" } { print $2 }') lastname=$(echo ...
0
votes
0answers
25 views

Need a shell script to loop launching a connection to a thin client, waiting, logging off, then connecting to a windows 7vm

I'm very new to Ubuntu and I need to have a shell script to do what the title says. I used: xfreerdp -u [uname] -p [password] -o --plugin drdynvc --data rdpeusb -g 1280x1024 -- [vm's ip] to make ...
1
vote
1answer
76 views

Script for trimming with ffmpeg

I'm recording radio broadcasts via DVB-C and gnutv. To trim the recordings I use ffmpeg. The synthax takes rahter long to enter in Terminal. So I'm working on a script to automatize this. Hiere it ...
0
votes
1answer
47 views

A shell file containing count but not showing when I try to run from crontab

I am new in writing shell script i write a script like this #!/bin/bash PID=$(ps -ef | grep "sh gps.sh" | grep -v grep | awk '{print $2}') if [ -z $PID ] then cd /opt/etrans/cronjobs ...
1
vote
3answers
1k views

Writing a bash script to read a text file of numbers into arrays, by column, on Ubuntu

I'm trying to write a little bash script on ubuntu 12.04 and have little experience. Odd little problem converting a text file of numbers into arrays. I need all of the first numbers, second, etc into ...
1
vote
1answer
55 views

piping using ssh without having to relogin for every pipe

I have an ssh connection and I have to send some local files and output to the ssh server. I know I can do this using the following command tar zcf - stuff | ssh user@server 'tar zxf -' I would ...
0
votes
0answers
56 views

hostapd run as service/startup

I have installed and configured hostapd in ubuntu and everything works as expected. However, I would like to start the associated config/scripts files automatically. I have created one script file ...
5
votes
4answers
2k views

How to start Virtual box machines automatically when booting?

I have many Virtual box machines in my Ubuntu12.04, each time i shutdown or reboot i have to start them one by one. I wanna a help in writing script for automatically autostart the VBox machines ...
0
votes
2answers
22 views

Simulate Enter Press in a Screen

I have successfully run command screen -S Run -X stuff 'stop'`echo -ne '\015'` in the terminal and had screen Run receive the stop command and then receive the simulated enter press. This results ...
0
votes
0answers
22 views

How to autorun bash script in terminal as root? [duplicate]

I'm trying to make this script to autorun at startup, it needs root priviges, but I'm trying to run it without typing in my password. I have tried to add it with crontab, but nothing seems to happen. ...
1
vote
0answers
30 views

Script to be run on WOL (wake on lan)

If you add @reboot xyz to your crontab xyz will be run on every reboot. Is there any way to run a script on WOL (wake on lan)? Any tip is appreciated Håkan