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
298 views

SSH - How to force execution of a script ( /etc/sshrc , ForceCommand, .. ? ) on login but still allow execution of the client's ~/.ssh/rc?

As far as i know upon SSH login the following files are executed [SERVER] /etc/environment [Client] ~/.ssh/environment -> can be locally overriden by "SSH_ENV" environment variable -> will ...
0
votes
1answer
172 views

Xdotool to automate moves in Epiphany (Boulderdash Clone)

I'm trying to automate critical moves in my favorite Boulderdash clone called "Epiphany" (available through Ubuntu Software Centre). In the following example the character should move: 3x "Down ...
-2
votes
1answer
172 views

How to fix the screen being to bright in Ubuntu 12.04 and up

How to fix the screen brightness and color being too bright in ubuntu.
0
votes
1answer
66 views

How to execute a script with Cron

I would like to schedule a simple script to execute when the machine reboots. I have other schedule other commands in crontab using @reboot without any problems, but I can't seem to get my script to ...
1
vote
0answers
155 views

How to use debcondf Show results with debconf-set-selections?

I'd like to know in common how to use the results of debconf-show with debconf set selections to precvonfigure deb packages with teh command line or within a shell script For example If I use sudo ...
0
votes
1answer
660 views

Ubuntu FTP script to take backup and upload in my FTP server

Hie all I am trying to backup of my application directory, database backup and then sending it to my ftp server at hetzner by using the following script and i get few errors my server details: ...
0
votes
1answer
138 views

how to check if PPA is already added to apt sources list in a bash script

Do someone know how to check if a PPA is already added to my system before i add it with the add-apt-repository command in a shell script. That would be very helpful. Thank you.
2
votes
1answer
36 views

How to write a 'hotcorners' script in Python?

I'm using Lubuntu 13.04, and a feature that I miss from Compiz is the hot-corners: it simply runs some command when the mouse cursor reaches a corner of the screen. So, I was thinking about writing a ...
0
votes
1answer
111 views

UbuntuOne using bash script to copy files

I am new to ubuntuOne. I need to copy / backup a folder, using bash script. Is it possible? I did not find where are the local copies of the files, saved by ubuntuone. Thanks.
0
votes
0answers
18 views

How to creat scripts with daily summary

How to creat scripts which showing me daily summary containing the number of data sent and received for a pre-defined fixed networks applications (wget, SMTP, FTP). Thank you for any idea :)
2
votes
1answer
244 views

“Can't open” an /opt file

This is my first post. I wanted to ask for any idea so to solve my problem. I am using Ubuntu 12.04 LTS, and my purpose is to use OpenFoam CFD software. I am trying to execute an script called Allrun ...
0
votes
1answer
22 views

problem in address of one user

hi i want to do these jobs by one scripts: 1- read the name of current user (I don't know what is it!) 2- switch to root user 3- go to root directory 4- go to the desktop director of first user ...
0
votes
1answer
123 views

run a script as non-root user

I want to run a script say some_script.sh(that requires root permissions, contains some sudo do something in a for loop) as non-root user. I have a script as shown below. I want to run this script as ...
0
votes
1answer
95 views

How to close Teamviewer automatically?

I can launch Teamviewer from a script. I can start/stop/restart the daemon, also. But, how do I close down the app window automatically (whether it be from a script, crontab, whatever)? Thanks in ...
0
votes
1answer
54 views

Remastering Different Distros on ubuntu

I want to be able to remaster different distro on my Ubuntu 12.x system. I had an old red hat system that I did this on. I had a knoppix that I added a bunch of in-house scripts. Also I had the PING ...
0
votes
0answers
60 views

Interactive Script BEFORE Login

I have an interactive script that I need to run BEFORE loggin in. What I have setup is a Script that looks at a value I've set on the Kernel line from Grub ie. backuptype=create_image What I've ...
1
vote
2answers
320 views

How to disable screen lock timeout from a script?

I'm looking for a way to disable screen dimming and desktop locking timeout from a bash script on Ubuntu 13.10. The script should be run when user logs in (configured in Startup Applications window) ...
0
votes
1answer
74 views

How to make resume script wait for ivtv initialization

I have a TV tuner card with an infrared sensor. I have made a script to remove/start ivtv kernel module and shutdown/restart lirc service on suspend/resume. The problem is that the lirc service start ...
0
votes
1answer
44 views

Add packages to Ubuntu Distro installation [duplicate]

I wanna create small change to Ubuntu Install CD. I want to add a few packages so when Ubuntu is installing, those packages also would be installed. So I wondering if it has some maybe ...
0
votes
1answer
170 views

Restart then shutdown using bash scripting?

I want to restart and then shutdown from terminal. Means that we want to startup terminal after restart and then shutdown automatically. What I am doing with explanation: Manually start my pc Run ...
0
votes
1answer
3k views

How to restart Teamviewer daemon from a bash script?

I've installed TV as a server on a Ubuntu 12.04 box running 24/7. Unfortunately, the daemon service sometimes bugs and disconnects. I can fix this at the terminal with : sudo teamviewer --daemon ...
1
vote
5answers
132 views

Hide multiple files at once with shell script

I'm trying to hide some files with some command, I tried the rm command, but it did not work and also tried to rename but did not understand how it works. The files that I want to hide have spaces in ...
3
votes
3answers
243 views

How to get longest line from a file?

I'm interested to find out the line number of the longest line from a file. For example, if I have a file with the following content: lalala tatatata abracadabra mu mu mu how can I write a bash ...
0
votes
1answer
79 views

Shell script for “intelligent” copying

I'm working on a shell script. To the backgroud: I recorded a lot of songs from the radio with my Mac. Each song is a *.eyetv "file" on my mac. Actually these "files" are just folders, containing a ...
5
votes
3answers
255 views

Convey some message to all users

Is it possible to write a shell script that enables any user (may not be root) to set a message(e.g. "Download on progress do not turn off" etc.) which will be conveyed like pop-up message (zenity or ...
3
votes
1answer
515 views

How to create a script to check for internet connection?

I'm new to programming in linux. I started bitcoin mining using linux mint xfce 15. I'm really good following directions, just don't know how to start. I need to create a script that can run every 15 ...
0
votes
0answers
202 views

shell script won't execute in .config/autostart

I have a simple shell scrip I am trying to get to execute on startup. I use gnome-sessions-properties to add it to autostart, but nothing is happening when i start up. I am able to manually execute ...
0
votes
1answer
166 views

bash script to auto mkdir on usb

I'm trying to have auto script to open dir on any removable device - different usb have different names and i want the user only to enter the device name since the path /media/user is a default in ...
0
votes
0answers
15 views

How to run a script automatically if there is any specific hardware is detected [duplicate]

I want to run a script automatically when a headset was inserted on its corresponding jack and a USB modem was inserted on its corresponding ports. Any help will be appreciated!
1
vote
1answer
86 views

Multiple possible interpreters in a shebang?

Trying to learn me some nodejs, I installed npm and the learnyounode module. Unfortunately, learnyounode tries to execute #!/usr/bin/env node and not #!/usr/bin/env nodejs -- as we have it setup in ...
0
votes
0answers
53 views

start specific programs in different workspaces at user login

I've some programs that I always run after my login: eclipse, terminator, firefox. So I want to create a script, to put in .bash_login, and that will be executed only when I login in a gui. This ...
0
votes
0answers
74 views

Mapping Network Drives on Logon

I'm attempting to prepare some laptops for use in our school district with Ubuntu. I have them on the domain, and you can login with your ADUC credentials no problem. However, I'm stuck at what ...
3
votes
2answers
150 views

Enter terminal mode with bash command

Is there a possibility to enter the terminal mode accessible with Ctrl+Alt+F1 with a bash command so that I can tell a script to do so?
0
votes
3answers
290 views

How to prevent script not to stop after apt-get?

I keep some bash snippets and copy&paste them when I needed for management. But I discovered apt-get cancels script execution. Here's my script where problematic. apt-get -y install gcc g++ make ...
1
vote
0answers
65 views

Why won't cron run my sh script?

Used gnome-schedule to create a script to set my headset as the fallback audio device because it keeps unsetting it when the headset gets disconnected or pc goes into sleep mode. Anyway, crontab is ...
2
votes
2answers
643 views

what could cause a script to fail to find python when it has `#!/usr/bin/env python` in the first line?

Trying to get casperjs running on Ubuntu 12.04. After installing it when I run I get: 09:20 $ ll /usr/local/bin/casperjs lrwxrwxrwx 1 root root 26 Nov 6 16:49 /usr/local/bin/casperjs -> ...
0
votes
1answer
92 views

Execute command on time Shell Script [duplicate]

I want to say I am a complete newbie but I want a shell script that will execute a command on a specific time for example on 6:45 am How is this done, a full example would be very useful! Thank you!
0
votes
1answer
52 views

Newbie question: running a custom script in terminal

I am complete new to Ubuntu, so please take it slowly: I'm trying to datamosh a video for my glitchart work and I've found a script (I THINK it's called script) for doing just that. But just can't ...
1
vote
1answer
53 views

ubuntu-vm-builder and first-login interactive script

I'm using ubuntu-vm-builder to create disk image on-the-fly. I want to use a script to change user keyboard on first login with --firstlogin argument with the following script : #!/bin/bash # Running ...
2
votes
2answers
217 views

Script to clean system [closed]

I want a script to clean my system. Clean unused dependencies. Clean apt-cache. Clean residual-config files. Remove broken packages. Only keep the latest version of packages and remove ...
1
vote
2answers
141 views

Copy “string” through command line

Can we copy a string with a command-line and have the ability of pasting it with Ctrl + V shortcut?
0
votes
2answers
71 views

Odd ubuntu shell script error

i have a simple shell script: #!/bin/bash var="foo" echo $var When ran, using 'sh shell.sh' (shell being its filename), i get the following error: : not foundh: 2: shell.sh: what even is this? ...
0
votes
2answers
73 views

Setting the icon_theme_path in python script

I've made a python script to add a new indicator in the systray on Ubuntu Unity. When i set a specific folder for the icon, the icon appears in the systray. Exemple : ...
1
vote
1answer
155 views

Python script liking to GUI using IDE

I am studying python. Now I can write python scripts (codes) to some extent. I used IDLE for this. I am interested in making GUI to those written programs. I like to do it using an IDE rather than ...
1
vote
2answers
348 views

Delete directory by referencing symbolic link

To set up the question, imagine this scenario: mkdir ~/temp cd ~/ ln -s temp temporary rm -rf temporary, rm -f temporary, and rm temporary each will remove the symbolic link but leave the directory ...
2
votes
1answer
1k views

How to set system-wide proxy address using shell script?

I want to set system Proxy address through my Qt application. So i was wondering if i could write a script which can be executed by my application every time to change the proxy address. I tried : ...
0
votes
0answers
35 views

make snap shot script

I am attempting to write a script take a snapshot of a given logical volume and delete any older than rotate_count. The makesnap tool takes a snapshot of the given logicalvol. The snapshot’s name is ...
4
votes
1answer
345 views

Why is $0 set to -bash?

First login process name seems to be set to -bash, but if I subshell then it becomes bash. for example: root@nowere:~# echo $0 -bash root@nowere:~# bash root@nowere:~# echo $0 bash -bash is ...
0
votes
0answers
51 views

How to configure screens in console or create screen configuration profiles?

I have two monitors and integrated GPU (Intel® HD Graphics 4600). It works fine for work or movies, but if I launch games in fullscreen mode - I get artifacts, glitches and so on. Temporary disabling ...
0
votes
0answers
11 views

retrieve statistics on Ubuntu packages

how can I retrieve a list of all packages or better specific packages offered by Ubuntu? Preferable, I would like to create a list of certain packages shipped by Ubuntu but on a computer in the cloud ...