In shell scripting, a shell such as bash runs a file containing a list of commands (a script). The script is effectively a program and the shell is its interpreter.

learn more… | top users | synonyms

2
votes
1answer
45 views

parse webpage upto n levels using wget

I am trying to extract URLS from a webpage up to user defined n levels using wget. I tried this wget -r -l$2 --reject=gif -O out.html www.google.com | sed -n 's/.*href="\([^"]*\).*/\1/p'` " It is ...
1
vote
1answer
21 views

can not run the command from shell script but it's fine when typing directly into terminal

I am trying to run a shell script with the bellow content ns script.tcl sleep 100 the command ns works fine when typing in terminal but says: ns : not found when runing from the shell script.
6
votes
0answers
647 views

Execute a shell-script when closing laptop lid

Now I have two scripts and I want to execute them respectively when I close the laptop lip and open it. How can I do this?
2
votes
0answers
474 views

How to persistently maintain cloned mac address on Network Manager?

I'm on Gnome 3, and it seems like I'm able to add cloned mac address to my network interfaces from the GUI wizard of Network Manager. The catch is, every time I reboot my computer the cloned mac ...
2
votes
0answers
736 views

Script to quit and restart nautilus doesn't work

As I pointed out in my question nautilus theme problem in 12.04 I have to type 4 commands after every logon as workaround for a theming problem. Since I didn't find a real solution I decided to put ...
2
votes
0answers
276 views

Block unauthorized usb device. Disable automount

I wrote a bash script that checks every second for new mounted USB devices. When a new device is mounted, my script gets its serial number and compares it with the serials I wrote in a text file, ...
1
vote
0answers
90 views

How to run program/application in full screen mode

I am running my program/application from command line like sudo ./MyApp and some of programs I run like sudo ./MyShFile.sh ( in .sh file I just call/run my programs). But I want that my program ...
1
vote
0answers
155 views

How to customize the font style in notify-send?

I am trying to change the format of text appearing in pop-up notification while using notify-send command. Here I saw that it can be done using HTML formatting. But that doesn't seem to be working for ...
1
vote
0answers
21 views

pause process during lockscreen

I used WhatPulse back on windows and got it installed on Ubuntu, too, but now sometimes, when waking up from standby, it expects an internet connection immediately and builds up a lot of ram and ...
1
vote
0answers
39 views

How to identify with desktop environment id installed to configure lightdm-theme

I have a creepy problem here. I have to identify the desktop environment installed by an user without to know with one it's used by an user to change the user session value ion some lightdm-files. ...
1
vote
0answers
126 views

How to get a list (from shell) of Icon Themes installed?

I'm developing a simple script for change the icon theme with Unity. How could I know all the current (Ubuntu & Unity) System Icon Themes with a shell command? There are a few folders in ...
1
vote
0answers
40 views

How to terminate server process?

I just created automation sending an email using a shell script, but it always running and send me an email every sec to my email. I'm using PID and that process name to terminate it, I'm writing ...
1
vote
0answers
78 views

Unable to connect to X11 display. is $DISPLAY set? - Yes, it is

I'm trying to run this in my /etc/init.d/rc.local. I had to manually add the exit 0 because it wasn't there by default if that makes any difference. cd /home/john/xcape && ./xcape -e ...
1
vote
0answers
45 views

14.04 update problem with executable file mode

Here's the problem: I create a file called foo.pl containing #!/usr/bin/perl as the top line I execute chmod u+x foo.pl I type ./foo.pl at the command prompt and get the following bash: ./foo.pl: ...
1
vote
0answers
42 views

How can I automatically reboot machine after usb pull off?

I have this situation - I've got a boot-able pen-drive with Ubuntu 12.04 for automated installation - when I plug the USB stick in installation begins from it. At the end of installation process I ...
0
votes
0answers
13 views

Zenity and Yad messages/warnings in Lubuntu

How to clean those messages from the terminal? ** (yad:2499): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not ...
0
votes
0answers
35 views

QT gui application not starting automatically on startup in ubuntu 14.04

I have two Qt applications, one is non gui called "App1" and another one is gui called "App2". As per my need I need to start "App1" on startup of Ubuntu 14.04 machine. This "App1" runs a sh file ...
0
votes
0answers
12 views

ERROR with gem for a ruby tool?

I am trying to install a tool script called bio-polyploid-tools and I am getting this error after command sudo gem install bio-polyploid-tools sammanmahmoud@samman[bioruby-polyploid-tools-master] ...
0
votes
0answers
36 views

ssh connection: trigger event/invoke shell script at predefines intervals

On the server side I am trying to achieve something like : after x hours of a user being logged in via ssh I would like to execute a shell script. And I want this time to be configurable per user ...
0
votes
0answers
28 views

Any problem launching script with infinite loop using cron?

If I run a shell script containing an infinite loop using cron @reboot, will that hang up the cron daemon or does cron keep moving and not wait for the job to terminate?
0
votes
0answers
32 views

Start Rails Application on Boot Ubuntu

I am trying to make my application Ruby on Rails (OpenProject) starting with the system boot, but to test the script as root, returns me the error: /usr/bin/env:ruby: No such file or directory. My ...
0
votes
0answers
23 views

OpenVPN --up called scrip does not work properly

I use such command to run my OpenVPN connection (part of script): gw=`netstat -rn|grep UG|awk '{print $2}'` openvpn --config ./openvpn.ovpn --up "./up $gw" >/dev/null 2>/dev/null& So I ...
0
votes
0answers
26 views

Run sequence of commands and ssh password

I want to create a script that allows me to run ssh, input the required password, and then execute another command on the ssh console. Is there a way to do that? For example, this is what I would ...
0
votes
0answers
18 views

Remote child process doesn't end

file test.sh contains below lines. !#/bin/bash while [ "1" ] do date done This file resides inside machine 10.1.1.3. I want to execute this script from a remote machine 10.1.1.2. Let say from ...
0
votes
0answers
45 views

Pass to the script keyboard key pressed after hotkey has invoked a Bash script

I assigned a custom hotkey Ctrl+Q to launch my bash script. #!/bin/bash read -s -n 1 key zenity --info --text "$key pressed" I'd like to have a script to detect which key followed the hotkey. Say ...
0
votes
0answers
118 views

How to turn ON/OFF screen monitor using shell script and 'xrandr' linux command?

I am trying to turn on and off screen monitor in Ubuntu14.04 using key bindings. I tried following shell script #!/bin/sh output=$(xrandr | grep ' connected ' | awk '{print $1}' | head -1) ...
0
votes
0answers
30 views

Bash script not creating screen

I have a script that I wish to run on a screen. The screen that already exists is killed correctly, however the screen is not created and the command not run. Any ideas? #!/bin/sh screen -S attorney ...
0
votes
0answers
21 views

Loop not getting exicuted for a particular date

I has a file with dates of the formats "2015-04-10" and "Apr 20". so i wrote this piece of shell script to extract the lines matching a date and store it in a separate file. the date is given in ...
0
votes
0answers
11 views

QJoypad profile switch on program close

I've just started playing with qjoypad on my ubuntu HTPC. I like it because it lets me use my xbox controller as a mouse, and switch profiles. I've read that xboxdrv lets you do the same, but I've ...
0
votes
0answers
70 views

How to press ENTER in Nano on Ubuntu-touch via abd?

When I'm connected to Ubuntu Touch (bq Aquaris E4.5 Ubuntu-Edition phone) via adb shell and I'm editing a shell script with Nano. How can I press ENTER to save changes? Nano does not accept the ...
0
votes
0answers
23 views

How to store last email in a file?

I wanto to set my bash detecting incoming e-mails and maybe execute commands in the emails, detecting programmed regular expresions, what commands does let me to do this? I'd like to have a solution ...
0
votes
0answers
30 views

Reconnecting network through shell script

I've written following code to reconnect to network: #!/bin/bash while [ "$var" != "end" ] do pingtime= $(ping -w 1 192.168.1.107 | grep ttl) if [ "$pingtime" = "" ] then $(sudo ifconfig ...
0
votes
0answers
109 views

How to change another user keyboard layout silently?

I'm working to automate development environments with Vagrant which manages Ubuntu Desktop 14.04 VMs. My Vagrant script: Creates the VM Setup a new user account based on the host user account Does ...
0
votes
0answers
66 views

Script to install software after clean install

I apologize for opening a new thread on this, as I am simply asking for a bit more info on this post Creating a script to install software after a clean install? -- but I don't have enough reputation ...
0
votes
0answers
52 views

ftp in script is asking password though the password is in script

Previously the below script have not asked password when execute but all of a sudden it is asking password. I have tried to pass the username, password and server name in single quotes but still it is ...
0
votes
0answers
23 views

display number of packets

need to write a script that takes and interface as parameter and prints to stdout like this: interface TX: no.of tx packs sent RX: no of rx packs sent this is what i have written, but it prints the ...
0
votes
0answers
82 views

Simple Mount Script Not Working?

just really not understanding what's wrong here. I had a script that worked fine on 14.04, but I screwed up something on there and accidentally removed some system apps and made it fail to boot. So, I ...
0
votes
0answers
84 views

x-shellscript opening with gedit

I've downlodaded this plymouth theme, but when I try running the install-orb script, it opens in gedit I already checked "Allow executing file as program" in properties, but it won't solve. @edit ...
0
votes
0answers
115 views

How to batch download youtube-dl trailer based on a folder name?

I have some folders with movies and I am trying to figure out how to download trailers from youtube Folder structure: |-Movie Name #1 (2008) |-Movie Name #2 (2013) |-..... Trailer file: ...
0
votes
0answers
18 views

Count total no of functions in .h files

I want to have a count of total exposed functions in my module? I tried grep -rn "(" *.h|wc -l but I am not getting exact answer How do I count total number of global functions in my module?
0
votes
0answers
18 views

Dual booting thwarted by rogue keyboard presses?

End goal: successfully dual boot Windows 8.1 and Ubuntu 14.04, both are already installed and working. I just can't get to the bootloader (I think it's called) to choose to go back to my Windows ...
0
votes
0answers
2k views

Using a samba path (smb://server/…) to check if a folder/file exists

I have a samba path, f.e. smb://server/path1/path2/ which is located when mounted at /var/run/user/1000/gvfs/smb-share:server=server,share=path1/path2/. I can easily check via filesystem path if the ...
0
votes
0answers
131 views

Comment text selection in Mousepad text editor?

Is there a keyboard shortcut, or a command, that I can use to comment a selection spanning multiple lines in Mousepad? This is language dependent, since comments in different programming languages ...
0
votes
0answers
281 views

Trying to debug a code, need some help!

so I'm trying to run an installer and I'm getting this message: $ ./install Preparing installation files ... Installing ... /tmp/mathworks_4504/sys/java/jre/glnxa64/jre/bin/java: 4: ...
0
votes
0answers
117 views

Shell script loop stops by itself

I have two script files like this. execute.sh #!/bin/bash #259200seconds = 5 days end=$((SECONDS+432000)) x=0 cp /dev/null ~/kill_start.txt while [ $SECONDS -lt $end ] do [[ $(cat ...
0
votes
0answers
32 views

SOHO Network Scripts

I have a trying to develop two simple scripts to automate the set up of a small office with a Ubuntu server and workstations. I am likely in way over my head, but I am trying to do it anyways. The ...
0
votes
0answers
66 views

Issue with running cgminer as a cron job - Ubuntu

I have installed cgminer in my machine and could able to start it without any issues when running ./cgminer in terminal. But for a specific feature, i am trying to invoke the cgminer from using ...
0
votes
0answers
152 views

switching kde activities in command line

I started taking a course on bash scripting, and i'm still a newbie in bash scripting...please i wan't to know whether it's possible to control and switch kde activities in kubuntu via the command ...
-1
votes
0answers
36 views

bash: ${debian_chroot!-}: bad substitution

So I'm learning how to shell script and i got this error. Every thing I've read on the other posts makes it seem like a directory file path like most terminal commands have stashed away. My version of ...
-4
votes
0answers
23 views

Shell script to read specific files in a folder and the change the filenames

I need a shell script that loops over all the files in a folder and does some actions on the files. For example. /data/LST/ABC folder has below: LSTFile1 LSTFile2 LSTFile3 LSTFile4 LSTFile5 ...