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.
1
vote
3answers
60 views
Bash script to determine ip address
Is it possible to determine the ip address of systems within a network using a bash script. And how.
0
votes
1answer
36 views
a script to shutdown the other pc in the network if they donot respond to ping command
A (program)script to shutdown the other linux operated Computer in the same network , if they do not respond to ping command otherwise a message to show that they do not respond.
please help me
0
votes
0answers
16 views
Auto upload on ftp when file saved [duplicate]
I want to know if it is possible(it should be) to auto upload my files on ftp when they change. Is there a batch script i can run in background? Thank you! :D
0
votes
1answer
20 views
routine program in ubuntu
I am trying to write a routine of my studies of next month. For that I want to write a timed schedule. That is a timed program that will tell me everytime I turn on my laptop which topics should I ...
1
vote
1answer
24 views
constantly check if the virtualbox is started or still booting up from a script
I am writing a shell script to start a virtualbox (ubuntu). After the command I want to put a for loop to keep checking the status of virtualbox and the script comes out of the loop only after the ...
1
vote
1answer
38 views
Hourly GIT Push
Is it possible for me to automate a Git push every hour via a batch script.
I would typically type in this:
git add *
git commit -m "latest update"
git push ...
0
votes
2answers
42 views
Problem on running shell script (how to NOT make it run from gedit) - Ubuntu 12.04
I want to run shell script or at least run it from terminal. I tried going to home folder/edit/preferences/behaviour and set executable text files to 'ask each time' but it doesn't even give the ...
3
votes
2answers
62 views
How to declare functions as variables
I want to declare variable with pwd() function, which will give me the current path. I want to use pwd() function as ${pwd} variable, something like that. How I must write? Thanks!
4
votes
5answers
181 views
Not able to execute a .sh file: /bin/bash^M: bad interpreter
I wanted to execute a shell script:
-rwxr-x--x 1 root root 17234 Jun 6 18:31 create_mgw_3shelf_6xIPNI1P.sh
I was trying to do by a standard procedure . But I am getting this error:
...
9
votes
5answers
431 views
Run a command with the argument from the last command
When running commands, sometimes maybe you need to run a command with the argument from the last command. How can you do this?
Of course, except the use of the arrow keys and Del keys: ...
0
votes
1answer
24 views
mp3info -p “%S” file.mp3 - return: file.mp3 is corrupt or is not a standard MP3 file
I want to get duration of .mp3 song in seconds using mp3info.
When I execute
mp3info -p "%S" file.mp3
output is
file.mp3 is corrupt or is not a standard MP3 file.
The file is correct ...
0
votes
0answers
22 views
How to, auto add desktop icon for all new likewise-open users 12.04
I want to add a desktop icon to the desktop of every user that logges on.
The system is connected to Active Directory using LikeWise-open, i dont want to manualy add the desktop icons to every user, ...
1
vote
0answers
31 views
How do I add a PPA in a shell script without user input?
Basically, I want to run add-apt-repository ppa:(whatever) without the "press Enter to continue" prompt. How would I do this?
Essentially, I want to deploy adding a repository in a shell script ...
0
votes
0answers
33 views
Shell script now working on post/get request
I have a simple script in php to fetch files from my github repository
<?php
echo shell_exec('git pull');
?>
When I ssh into my server and run this script like this:
php github.php
I see ...
0
votes
1answer
30 views
Partially overwrite in a file through script
I see
<command> >> <filepath> appends the command line to the file
and
<command> > <filepath> replaces the entire contents of the file with the command given ...
0
votes
2answers
67 views
Move Multiple Files To Multiple Folders Based on Names of Files
I have a bunch of files in one folder named numeric as 001001 .. 001002 .. 002001 .. 002002 .. and so on until 114001 .. 114002 , i want to move every group of files that start with the same number to ...
0
votes
1answer
39 views
How to list the source URLs from saved html files from a folder?
I have a lot of html files in a folder. I used them
in a project. I want to build a References.txt
file in which the URL from which each html file was saved
will be listed with the time stamp on which ...
0
votes
0answers
12 views
shell script error ( java related) [duplicate]
I am attempting to simplify a question I asked earlier since no one seemed to be interested in it. I am hoping by simplifying it more people will look at it. Here is the original post. when I try to ...
3
votes
1answer
354 views
How to run shell script via terminal using ubuntu 13.04?
I just upgraded to 13.04. Before this when I click on a shell script file it'll give an option to run via terminal but now the option is no longer available and when I click the file it'll directly ...
0
votes
1answer
52 views
HTTP POST and GET using cURL in linux
I had server application in asp.net in windows in that i had a web service for that .
how can i call web service in ubuntu using shell script by using cURL command
0
votes
1answer
21 views
Which system calls will be used for command : cat < in (in is an existing regular file)?
I am an undergraduate computer engineering student and this question is one of my system programming course's exam question.Actually the question is " will not be used" and the options are : open, ...
0
votes
1answer
30 views
Shell not handling escape character spaces
Recently it seems that shell has changed how it handles spaces in parameters. It used to handle them properly (Or at least as I intended it to), but now it recognises it as a bunch of different ...
0
votes
2answers
39 views
JAVA_HOME : .bashrc or .profile
I need to set some variables such as JAVA_HOME and add them to the PATH. Can I somehow define them in .profile, and have them pulled into .bashrc? Or maybe add them to a 3rd file, and have that file ...
0
votes
1answer
54 views
Run a shell script from terminal
I have a shell script at /home/user/android-sdk-linux/tools. I wish to run the script from the terminal by typing ddms so I added :/home/user/android-sdk-linux/tools/ddms.sh to /etc/environment and ...
1
vote
3answers
376 views
When trying to run Android Studio sh file, chmod +x and checkbox just instantly fails (as root too)
I want to run the new Android Studio IDE just released at Google I/O 2013, and when I try to execute studio.sh, it opens it in a text editor. If I enable running as application in properties, it ...
0
votes
1answer
120 views
Run script on remote machine via telnet (not SSH)
I need to somehow run a script which resides on a remote machine running Ubuntu.
SSH or any other connection type that requires complex encryption is not possible.
The client that will connect to the ...
4
votes
1answer
56 views
shell script to conditionally add apt repository
I want to write a shell script that will add an apt repository.
I know that I can do it using sudo add-apt-repository -y <repo>.
My question is can I do it only if the repository was not ...
0
votes
1answer
83 views
Macxchange Script to Change MAC and Hostname in ubuntu 12.04
I'm trying to adapt a script in backtrack to work with ubuntu. I keep getting an error on line 14 which is the "if [ $? == 0 ]; then" line
the script was found on
...
0
votes
2answers
85 views
Find files with same name in different folders
This is a tricky one. I need to do the following using 2 folders, the movie folder and the subtitle folder:
Search for every movie inside the movie folder, for each file it finds, grab the files ...
0
votes
1answer
43 views
Starting and stopping of applications
I need to make my restart process lesser commands. I dont want to code anything or create a service. So I created 2 scripts to do that. But even then the process is too lengthy. Is there a way to kill ...
1
vote
3answers
70 views
How to run a script in boot as root
I had a script that automatically enables my wifi without using networkmanager but I don't know how to run the script as root while the system is booting.
0
votes
2answers
70 views
linux script command explanation
When I read a script of makefile, I meet with the following linux script command:
mv obj/*.o . 2>/dev/null
What does this command mean? I understand mv obj/*.o . means that all the files with ...
0
votes
1answer
24 views
Any way to tabulate the package name and license avail on Ubuntu repo? [duplicate]
I need to create a table with all installable packages on first column and its license in the second.
e.g.:
Gedit | GPL
1
vote
2answers
148 views
Mr Transmission, please turn off the PC after all downloads are completed!
#!/bin/bash
echo "password" | sudo -S halt
I pointed this script to "Call script when torrent is completed" option under: Edit > Preferences > Downloading
Problem: this script shut-downs the ...
0
votes
2answers
88 views
Where to start in Linux programming
I am a student and I would like to study all these terminal stuffs and all. You all will be experts in this subject. I would like to know where did you all begin and what must I do to be an expert in ...
0
votes
2answers
45 views
Failing with shell script
I am trying to run the following script in Ubuntu 10.04 but hitting with different issues for the intget i declaration. Could anyone please help me asap
integer i
i=1
while true
do
read ...
3
votes
1answer
92 views
Should recursive shell script lock up the system?
I made a typo and ran my shell script recursively. Example:
#!/bin/bash
# filename: kill-me-please.sh
./kill-me-please.sh
This caused my system to become unresponsive and all I could do was a ...
0
votes
0answers
93 views
Problem in Social Engineering Toolkit in My Ubuntu 12.10 System
I Just Installed Social Engineering Toolkit (SET) in my machine in /opt/ directory .
i allready installed Metasploit , and changed metasploit directory to /opt/metasploit
set_config
file from ...
1
vote
0answers
20 views
Need to remove Metasploit from my Ubuntu 12.10 system [duplicate]
Tonight I installed Metasploit in my Ubuntu 12.10 it did not work properly, so i removed it by executing the following command in terminal
sudo rm -r /opt/metasploit
now when i try to re-install ...
0
votes
2answers
24 views
my user ~/bin folder is not working
I'm running 12.04
I have two files
/usr/bin/uim-tomoe-gtk
~/bin/uim-tomoe-gtk
the first is the tomoe kanji program
the second is a script that runs kanjipad instead
#!/bin/bash
exec kanjipad ...
0
votes
1answer
61 views
delete file from /etc/profile.d directory [duplicate]
I have made a small script and placed it in a file inside /etc/profile.d directory. Since then, I can not login in ubuntu 12.04, nor in terminal as the normal user. I can only login as root from ...
1
vote
0answers
37 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?
1
vote
1answer
51 views
Rename files in group
I've folder and file structure like
Folder/1/fileNameOne.ext
Folder/2/fileNameTwo.ext
Folder/3/fileNameThree.ext
...
How can I rename the files such that the output becomes
...
1
vote
2answers
69 views
Installing packages remotely via bash script in ubuntu
I am trying to install firefox packages to all my linux hosts remotely using a bash script. But when ever i execute the script i get the following error. How do i enable DISPLAY in bash script?
...
2
votes
1answer
42 views
Flexible vector construction in tcsh
vector generation is a technique which allows us to generate lists without defining iterators and write loops. They are useful in many situations, and can turn code to much more succinct and compact. ...
3
votes
1answer
50 views
Can I use a custom shell with upstart script stanza?
I'm writing a few daemons implemented in pure shell script and would like to use zsh(powerful substitutions, modules with socket/tcp handling, etc) instead of the default /bin/sh. Can I tell the ...
3
votes
1answer
117 views
Help Debugging Backup Script
Every 3 hours the script will run and backup a folder "SOURCE" and it will save it along with the other backups of the current day in the folder "month-day-year" e.g. "03-24-13". When a new day comes, ...
5
votes
1answer
62 views
How to get select statement choices into If statements?
I'm very new to programming on Ubuntu. And I'm trying to do a simple bash script.
I have a select menu working but I want the choices made in that to go into a number of if statements, corresponding ...
11
votes
1answer
177 views
Bash comparison and expression operators
I'm new to bash programming. I've read two good, long guides, but they made a mess in my head about operators and keywords.
Which are more commonly and widely used? I don't know when to use which ...
2
votes
1answer
48 views
awk quoting program text
I just came across a gotcha in awk, and I would like to know if anyone can explain to me why this happens.
The following 2 lines behave differently if I run:
# grep -Rl BASE_DIR --exclude-dir=.svn * ...










