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

1
vote
1answer
18 views

Script that put filenames at working directory in text files with some additional strings

I need to make a script that put filenames at working directory (with specifical extension) in text file with some additional strings: For example: if I interested in files with extension "i" and ...
1
vote
1answer
37 views

Data transfer between two remote servers linux (sftp)

I work remotely trough my Linux system. I have data on server A which can be accessed only through SFTP. The second server is an HPC cluster. I want to fetch data in my HPC cluster working directory ...
1
vote
1answer
86 views

transmission-cli connected to peers but not downloading

I'm using my Ubuntu-Server and transmission-cli to download torrents overnight. When I try to download the Ubuntu 12.04.5 Server torrent transmission connects to various peers, but doesn't download ...
1
vote
1answer
18 views

package “state” vs “selection state”

All answers that I read, suggest listing/saving package selection states. i.e. dpkg --get-selections But the selection state could be different from actual. So why use that? Is it just because ...
1
vote
1answer
217 views

Problem with shell script to reboot computer/switch to windows

I have little experience with linux and hardly ever wrote an shell script, but needed a workstation with both windows and linux to do certain calculations. The workstation is however mostly used ...
1
vote
1answer
323 views

How to find the path of a freshly mounted USB Drive dynamically?

I want a side script or a settings change that fires a second or primary script that does the actual work. I do not need to do it just for my computer. So it should work on any Linux computer. I need ...
1
vote
1answer
61 views

Concatenate of Hostname in script is not working

I have to concatenate the Hostname in a file name and ssh it to a machine what i have currently is scp ../output/OutputFile50.txt sarah:~/client/output/OutputFile50${HOSTNAME}.txt it is working ...
1
vote
1answer
2k views

Permission when running script in Vagrant using Vagrantfile

I have created a vagrant box for running rails applications and I have managed to create it manually. My next step was to create a shell script that I can include in the Vagrantfile so when creating ...
1
vote
1answer
71 views

Telnet at Login Question

I am trying to setup a dummy terminal. The system automatically signs in as the user I want. The next step is for it to automatically telnet to a server. I have the autologin working and the ...
1
vote
1answer
202 views

ffmpeg-video trim from the end of the video

I have some videos of different duration.I want to cut(remove) the last 5 seconds of all videos.Can i use 'ffmpeg' in a loop to trim the videos?please help me.
3
votes
0answers
501 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
69 views

How to have a video player resume from where I last left off?

I'd like to be able to launch a video player (VLC, SMPlayer) via Terminal, using some command like resume_media and then it will automatically find the most recently played media file (.mkv, mp4 etc.) ...
2
votes
0answers
437 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
687 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
246 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
38 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
12 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
68 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
36 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
57 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
41 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
2 views

Script that prevents the software to run unless other associate software is already running

I have a situation here. We wanted to prevent a software to run successfully unless the other software is already running. If the script has been run, it run the main software and it will check if the ...
0
votes
0answers
4 views

How to autostart a shell script on Ubuntu-touch?

I want to start a shell script on my bq Aquaris E4.5 Ubuntu-Edition whenever I switch on the phone to syncronize my calendar and contacts via syncevolution with my owncloud server. How can I ...
0
votes
0answers
7 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
19 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
27 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
65 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
46 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
28 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
26 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. ...
0
votes
0answers
20 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
40 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
55 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
71 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
16 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
54 views

Shell script to check url

I am trying to write a shell script to check for the existence of a particular directory in a particular domain name. For example, I have a web site named www.example.com. I want to check whether the ...
0
votes
0answers
999 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
88 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
224 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
91 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
22 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
50 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
98 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 ...
0
votes
0answers
206 views

unable to run script using “startup applications” option in ubuntu 14.04

I am trying to run following script to run my rails application on startup but unable to execute. run_my_app.sh #!/bin/bash cd /home/<user>/<my_rails_app> && rails server ...
0
votes
0answers
215 views

how to install ksymoops on Ubuntu 14.04

I want to analyze kernel crash(Oops) using ksymoops. I am trying to install ksymoops on Ubuntu 14.04(LTS) 64 bit using command sudo apt-get install ksymoops but unable to install. Below mentioned ...
0
votes
0answers
518 views

move files and auto rename if same name | bash script find all *.extension

Something like "--auto" in: http://doc.bazaar.canonical.com/beta/en/user-reference/mv-help.html It seems a bit complicated to --no-clobber (-n) and work on return codes if [ $? -eq 1 ];then ...
0
votes
0answers
61 views

reverse shell to ubuntu returns input as output

i start a reverse shell session from an an ubuntu 12.04 server to my host 12.04 desktop. the specific actions i take can be seen here: How to open reverse shell from NOWASP? but in a nut-shell, i ...
0
votes
0answers
78 views

How to open reverse shell from NOWASP?

I'm using 12.04 LTS and the server is 12.04 LTS server. So, I'm teaching myself some pen testing and right now I'm trying to use netcat to open a reverse shell from nowasp, my nowasp is on a VM and ...