Scripting is series of command written in plain text file. The shell can read this file and act on the commands as if they were typed at the keyboard, the shell also provides a variety of useful programming features to make your scripts truly powerful.

learn more… | top users | synonyms

-3
votes
0answers
29 views

Linux scripting [closed]

First I made a file called telephone containing: Jan;032569874 Annemie;014588529 Hans;015253694 Stefaan;011802367 And what I now need to do is making a script where you are asked to ...
0
votes
0answers
22 views

Blocking particular applications in Ubuntu 14.04 [duplicate]

I want to ask is there any command or script to block applications selected by user from opening up and running in Ubuntu? (I know there are parental controls but I want to know about script.)
0
votes
0answers
21 views

Configure server machine

I have a server machine. Number of networks and sub-networks are connected through it. I want to configure my server machine like, every client machine can install operating system through network ...
0
votes
0answers
67 views

How to fix RAID1 array by mdadm with script?

In system works two RAID1-arrays madadm. There is one reserve disk to change faulty disk. I need to write a script which will be monitoring disks and automatically fix degraded array. How do you ...
0
votes
0answers
24 views

image mounting from usb drive

I want to create a script on my raspberry pi that allows the ability to auto run an image file within a browser (or any other program that would allow a gif file to loop) as soon as the drive is ...
0
votes
0answers
52 views

Plymouth scripting (bootsplash) several images (like gif)

I'm trying to make a simple Plymouth theme but i'm not entirely sure how to make it "my way". Here's a sample of my script for my theme. drift_image1 = Image("final1.png"); drift_sprite1 = ...
0
votes
0answers
7 views

About Keyboards and extremely advanced shortcut scripting

Is it possible to set qwerty keys as shortcuts? "Thats positively MAD, why would he want to do such a thing!" Well bob, im so glad that youre just the voice in my head... So, if I were to press and ...
3
votes
2answers
625 views

How can I know Battery is present or absent via script?

I want to know which command should I use in my script to check the Battery if it's present or absent. like an if condition. thanks When I try with following command I get error. test@test-pc:~$ cat ...
1
vote
2answers
42 views

Do higher level scripting languages use shell scripts to work?

I'm just learning about bash and when I saw that bash uses 'echo' I tried to search for the relationship between PHP and bash and it seems like people are building programs were bash script and PHP ...
1
vote
2answers
90 views

Automating rsync commands

I currently have too many rsync commands that I run on a day to day basis. Could someone be kind enough to let me know how I can automate these commands? I am new to Linux so a little bit of ...
2
votes
1answer
55 views

What is a simple command/process I can run to prevent Ubuntu from sleeping?

I want to make simple "sleep" script for Ubuntu. So I can watch Hulu and the machine will not suspend or turn off the display. I think I can figure out most of it, but this part I don't even know ...
0
votes
1answer
34 views

Create a clickable install script for software

I want to create a simple script that a user can download, click on, and it will: request their root password through some sort of pop-up interface then sudo apt-get install a package to their ...
3
votes
1answer
776 views

Python scripting - How to execute linux commands? [closed]

I have to do a bunch of file copying, moving, svn check out commands, directory checking etc. and I'm trying to make a script to do it for me. I have basic python syntax, but I'm not sure how to use ...
0
votes
1answer
60 views

xdotool could not move mouse inside firefox

I have been trying for many days to get xdotool to move and click inside firefox but I couldn't. So please help me. My script was simple but it didn't work : #!/bin/bash firefox www.google.com # ...
2
votes
1answer
61 views

How to run a custom command for any X session

I need to patch the gamma on my monitor that is really out of balance, in short I need to run a command like xgamma -gamma 1.2 for any X session that I might start on my machine. My problem is that ...
5
votes
1answer
232 views

Scripting with variables from file

I have several videos on my PC that I would like to shorten. For instance I have a 30 sec video where I want to have the section from sec 15 to 20 (a 5sec video). To cut this, I use avconv. avconv -i ...
1
vote
1answer
31 views

Print out the amount of times 2 words appear in the syslog. But also have it tell me how many times for each hour

So I'm trying to create a bash script that looks for two words in my syslog file. Then I want the script to print out how many times those two words have appeared. Also I want it to print it out for ...
0
votes
1answer
1k views

How to create & execute a script file [closed]

Is there a way to create and execute a script file in Ubuntu 14.04? Perhaps something like Windows batch files. Specifically, I mean the default scripting language of the Ubuntu terminal (Bash). ...
0
votes
1answer
60 views

Understanding some ubuntu shell commands

for a computer science work i need to understand how a script that was given to me works. However there are some commands that i have no idea what they do and ive tried googling them but had no luck.. ...
0
votes
2answers
102 views

line 45 Syntax error: unexpected end of file

Now no matter what I do it just always says that even with a fi it doesnt do that help me debug the code please. also this has 44 lines of text and it says line 45 also the ascii art is just a dog it ...
1
vote
1answer
125 views

How can I remove an entry from a list in a shells script?

I have the following script: #!/bin/bash # Bash Menu Script Example PS3='Please enter your choice: ' options=("Option 1" "Option 2" "Option 3" "Quit") select opt in "${options[@]}" do case $opt ...
0
votes
0answers
23 views

Startup script for pxeboot

I am working on pxeboot. Now i want to do startup script in pxeboot server and whenever client started the startup script will run on the client machine. How to do that. ?
-2
votes
1answer
115 views

Shell Scripting [duplicate]

I'm trying to run my .sh file but when I try to execute it it doesn't work. I did echo '#!/bin/bash' > cadetkpgm.sh in order for the .sh file to be executable but when I use ./cadetkpgm.sh or bash ...
0
votes
2answers
105 views

Nano save to stdout (or an inline editor for terminal)

Is there a way of saving nano to stdout? Or an inline editor for terminal? I mean, I would like to do things as for example, editing an interactive php script like (from terminal): $ php ...
0
votes
2answers
861 views

Command to run GUI Frontend for apt-get update

I want know, if there is any command to run apt-get update in GUI like in the picture following: All i want to do is to write a script which will update the software sources through this gui ...
-1
votes
2answers
4k views

create a file before writing into it using python [closed]

I am new to python. I wanted to know if I could create a text file in the script itself before writing into. I do not want to create a text file using the command prompt. I have written this script ...
1
vote
0answers
11 views

How can I install ubuntu-restricted-extras without having to confirm the ttf-mscorefonts-installer licenses manually? [duplicate]

Whenever I do a fresh install of Ubuntu, I have a whole lot of programs I install and remove by using a few big apt-get commands. I use the --assume-yes flag so I don't have to confirm the ...
3
votes
1answer
1k views

Search specific text from file and output the line (Shell script)

Suppose I have a variable $str1 str1="20140121-21:48:26|Joanne Frances|" What I want to do is search that part in the file. The file contains, for example: 20140121-21:48:26|Joanne ...
-2
votes
4answers
26k views

How do I read a variable from a file?

I want to insert in my script a value (string) that I would read from a text file. For example, instead of: echo "Enter your name" read name I want to read a string from another text file so the ...
3
votes
2answers
234 views

How to batch organize files?

I have a directory with gigabytes (about 8gb) of small individual files. I want to organize them into directories by date. The date it was created is part of the filename. Here is an example of a ...
2
votes
1answer
3k views

Assign VNC password using script

I am using a script to automatically set up a computer. I need to assign a password to the vnc server for the user, which is normally done using the vncserver command. However, it prompts for the user ...
2
votes
3answers
3k views

How to discover the IP addresses within a network with a bash script?

Is it possible to determine the IP addresses of systems within a network using a bash script? And how?
1
vote
1answer
153 views

Need a way to start web cam recording at specific time

I have a laptop with an integrated camera and I want to write a script that will record a 10 minute video when the clock reaches a certain time. What apps/commands can I use to achieve this?
0
votes
1answer
127 views

Bash Menu issue / question?

There is another thread for this topic but it is closed. I would like to revisit this. I m trying to write a utility script for myself. However i am not a programmer so I wanted to get some feed back. ...
0
votes
1answer
384 views

Running binary from shell script creates core?

I am facing an issue when I am running my executable(binary program) from the shell, Its running fine. But when i run that executable from shell script then that executable creates core dump. For ...
4
votes
1answer
203 views

Function inside .profile results in no log-in

I've created a custom function in my .profile, and I've added right at the bottom, after my custom aliases : # custom functions function eclipse-gtk { cd ~/development/eclipse-juno ...
4
votes
2answers
156 views

How can I sort packages by file size when searching the repositories?

I'm trying to look at some statistics on the size of packages in the Ubuntu repositories, and I'm hoping to sort my searches of packages in the repositories by file size. Is there a command that will ...
4
votes
1answer
1k views

How to detect image dimensions and run commands on them?

I have a directory full of images, some of which are portrait-sized instead of landscape-sized, and I want to open the portrait-sized ones with an image editor. I can run the imagemagick command ...