Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms

2
votes
2answers
75 views

Why is my repetition condition with grep range not working?

Searched for a solution on SO, Ask and Unix/Linux but I am lost trying to figure out how to write a conditional with a grep range: Go through: 1-20_something 100-200_something 2-100_something ...
4
votes
1answer
234 views

Shut down list of servers given in a file

I have a list of 17 servers in this format 172.16.1.4 #servername-A 172.16.2.75 #servername-B 172.16.5.53 #servername-C 172.16.5.61 #servername-D i'd like a script that can ...
-1
votes
0answers
15 views

Kubuntu 14.10: Adding script file with arguments to KDE start menu

I'm having a seeimingly simple problem that I cannot figure out. I have a script file to run Wolfenstein 3D in Zdoom. The script looks like this: ~/Downloads/zdoom-master/zdoom ...
2
votes
1answer
30 views

phone book script

Good day I am a newbie in Linux scripting, and I am now exploring LINUX then suddenly I was motivated to create a program and I want to create a phone book program I am now done creating the menu that ...
1
vote
0answers
9 views

Automatic software management for user groups

When adding new users, is it possible to install software based on their user groups? For example a Netbeans IDE for say a 'Java development' group or a LAMP stack for a 'web development' group. ...
0
votes
0answers
16 views

sequence of pacmd used by unity-control-center sound

I'd like to script the sequence of commands to switch from speakers to bluetooth headset or external bluetooth speaker. I found the correct sequence up to a certain point: pacmd list-sinks Once I ...
2
votes
3answers
65 views

Compare Strings in Bash

Heres my code (so far): var=$(sudo cat /dev/ttyUSB0) echo "$var" if [ "$var" == "OK" ] then echo "Everything is fine" else echo "Not OK" fi As the output of this script is ...
-2
votes
1answer
57 views

how to execute php script in ubuntu 14.04 [closed]

how to execute php script inside html in ubuntu 14.04? <html> <head> <title>Hello World</title> <body> <?php echo "Hello, World!";?> </body> </html>
6
votes
5answers
369 views

How do I delete everything after second occurrence of quotes using the command line?

I have this store in a variable sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00 ENTERPRISE compaq VARIABLES { scellNameDateTime, scellSWComponent, ...
0
votes
0answers
20 views

Tmux Signaling Events

I'm not sure if this is possible but here's what I have running on tmux. (Using tmuxinator or tmux same idea). This is my mux config: name: dummy root: ~/projects/dummy windows: - service: ...
3
votes
2answers
210 views

changing string with sed, where did it go?

$ cat test-paths.txt test/sub2/configuration.php test/sub3/configuration.php test/configuration.php test/sub1/configuration.php $ cat find-host-test #!/bin/bash for i in `cat test-paths.txt` do ...
0
votes
0answers
31 views

Install linux-image-$(uname -r) non-interactively

How do I install linux-image-$(uname -r) non-interactively? sudo apt-get -y install linux-image-$(uname -r) The above command will get me past the initial "do you want to install this" prompt, but ...
0
votes
1answer
166 views

How do I create a script to restart a service every two hours? [duplicate]

I want to make a simple init.d file that makes it possible for me to reset a trial service that I'm using. I am currently using CodeSys and the startup script cuts me off after 2 hours, so I need to ...
1
vote
0answers
133 views

list all files in parent and sub directory using perl [closed]

$dir="/home/httpd/cgi-bin/r/mera"; $dir1="/home/httpd/cgi-bin/re/plan"; opendir(DIR,"$dir")||die"error"; while($line=readdir DIR) { print"$line\n"; opendir DIR1,"$dir/$line"||die"error"; ...
1
vote
3answers
92 views

How to cat in for loop

I have 500 folders containing many *_1.fastq.gz and *_2.fastq.gz files per folder. I want to: cat *_1.fastq.gz > Combined *_1.fastq.gz & cat *_2.fastq.gz > Combined_2.fastq.gz per ...
-1
votes
1answer
51 views

Command output to file, new lines at top [duplicate]

I'm rewriting some 20+ year old Unix scripts and I want the output to go to the screen and a file. I know this is possible with tee. Is there a similar command that stacks new lines on top, at the ...
0
votes
1answer
91 views

How do i write a terminal script to setup ubuntu for me instead of spending days every time?

From what I understand I can make a text file with all commands same as I would type in terminal, make it executable and run it. Would running sudo mysetup.sh or mysetup.txt be OK so not typing PW ...
0
votes
2answers
54 views

trying to get script to work

I am writing a script and the following will output desktop-session enviroment when used from command line, but puts out nothing if used in a script.sh, with no faults just a blank line. Why ? Could ...
0
votes
1answer
273 views

Bash Script - Editing Lines on Text From File

I'm using a bash script to read in data from a text file. #!/bin/bash file="/home/nexusfactor/Desktop/inputData(linux).txt" while IFS= read -r line do # display $line or do somthing with ...
0
votes
0answers
54 views

OCR for getting text from an image. Error management

I want to use an OCR program to obtain some text in an image. The text is not black on white so I don't know if it will be possible. wget -q -O image ...
0
votes
1answer
144 views

Linux alternative to Windows Script Host

I've just switched from Windows to Ubuntu. Really enjoying it right now and haven't encountered any issues whatsoever. The only thing is that I'm really gonna miss a lot of useful things that Windows ...
2
votes
0answers
92 views

solaris tail on ubuntu

Is there a way to make linux tail understand the Solaris tail syntax (precisely like tail +2)? The short story is that I have some update scripts written for Solaris on the repo and I cannot modify ...
0
votes
2answers
59 views

Move each filename into filename subfolders [duplicate]

I have a directory structure like this file 1.ext1 file 1.ext2 file 1.ext3 file 2.temp.ext1 file 2.ext2 file 3.ext1 I want to create each subfolder and move each file name no matter what extension ...
0
votes
0answers
24 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
24 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
114 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
34 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
142 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
18 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
695 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
83 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
268 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
135 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
54 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
1k 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
2answers
195 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
136 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
275 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
39 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 ...
2
votes
1answer
7k 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
73 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
373 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
286 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 ...
-2
votes
1answer
134 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
171 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 ...
1
vote
3answers
2k 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 ...
3
votes
1answer
3k 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
5answers
65k 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
328 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 ...
4
votes
2answers
4k 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 ...