Ubuntu :: Need To Make Bash Script Files

Apr 16, 2010

I need to know what is the best method for teaching yourself how to make bash script files

View 8 Replies


ADVERTISEMENT

Ubuntu :: Make Bash Script Files?

Apr 16, 2010

I need to know what is the best method for how to make bash script files

View 4 Replies View Related

Programming :: Bash Script - Make Sure All Files Have Certain Permissions

Jan 14, 2011

How can I iterate over all the files in the current directory to check for certain permissions? This is what I have:

Code: #!/bin/bash
for file in *.tar.gz
do if [ -r "$file" ]
then echo "$file is readable"
else echo "$file is NOT readable"
fi done

But this only checks that the current user has read permissions for each file. I want to check that the group "others" has read permissions for each file. How can I do this? Is there a built in function to check if a file has read permissions for the "others" group? Otherwise, I thought I might be able to use this:
Code: $ stat --format=%a file
744 And parse the output "744" and make sure the 3rd number is between 4 and 7 (since the octals 4-7 have read permissions for others).

View 2 Replies View Related

Software :: Bash Script Calling Make Files With CFLAGS Prepended?

Feb 6, 2010

Most all of this works when I execute it manually, but I cannot figure out how to get a bash script to execute it automatically.In this particular case, I am trying to build the xorg utilities. If I manually step through the process, prepending the commands with CFLAGS, LDFLAGS, etc, all of the packages build.So I created a bash script, test.sh:

Code:
#!/bin/bash
export INITFS=/initfs

[code]...

View 5 Replies View Related

Programming :: Bash: Rename Files In Alphabetical Order And Make Extensions Uppercase?

Oct 21, 2010

I am trying to write a bash script that will extract a .cbr (.rar) file, traverse the extracted files in alphabetical order and rename them 001.JPG, 002.JPG, 003.JPG, etc.So far I only have this much to extract it:

Code:
#!/bin/bash
#

[code]....

View 8 Replies View Related

General :: 'make Menuconfig' To Make These Files Modules Rather Than Compiled Elements?

Feb 25, 2011

I need to modify fs/open.c and fs/read_write.c to make my modifications. I cannot find any options in 'make menuconfig' to make these files modules rather than compiled elements. I'm thinking these cannot be modules because the file system won't work without open.c and read_write.c. Is this correct - I cannot compile fs/open.c and fs/read_write.c as modules, only as compiled elements? Or, is there some way for a module to overwrite these routines when the module is installed and re-enable the routines when the module is removed?

View 3 Replies View Related

Software :: Making A Bash Script To Read In Different Files And Rename Output Files?

May 7, 2009

Until now i haven't had to dabble with bash scripts.

I have a program that reads in data files. These are named datafile01_R, datafile01_G, datafile01_B, they then increment, so datafile02_R etc i have about 600 of these. the program reads in 3 data sets at a time from each run, so files_01 r, g, and b.

The program then does its magic, and outputs about 40 different files, depending on the file, they gone to folders named R, G, B, psa, or tracking.

The program itself has configuration files to say where the files should gone when analyzed, there is also the config files that reads in the data sets.

At the moment i have to run one set of data, then go in and manually change the input file location, and run again. But, doing this, even though a different data set, the new set overwrites the old set in one of the output folders. So i need a way to increment the output filenames after they are written and before the program is run again with the new data set.

View 1 Replies View Related

Ubuntu :: Bash: How To Make ${var%% *} Work

May 1, 2011

bash: how do you make the construct ${var%% *} work? I am trying to select the first word from a variable which contains many space-separated words. I am running Ubuntu 10.10 with GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu) and when I try to use this construct, the expression returns the complete variable with no removal of trailing anything.

View 3 Replies View Related

Ubuntu :: Make A Automated Build-script With Bash

Apr 13, 2010

I'm trying to make a automated build-script with bash but i keep getting different errors.

Code:

#!/bin/bash
gpg --import /home/epm/first_installation/config_chroot_sources_local.gpg
gpg --import /home/epm/first_installation/config_chroot_sources_packages-inl-fr.gpg

[code]....

View 5 Replies View Related

Ubuntu :: Make A Bunch Of Graphs Using Gnuplot From A Bash Script

Nov 14, 2010

I've been trying to make a bunch of graphs using gnuplot from a bash script. The tricky thing is that I have to divide values from two columns: Code: plot "results.csv" using 1:($4/$6) notitle with lp When this command is called from a bash script, the columns get mixed up with script arguments. how to make it read the column values like in the interactive mode?

View 1 Replies View Related

Ubuntu :: Bash - Make A Automatic Wordpress Installer Script

Mar 17, 2011

I'm trying to make a automatic Wordpress installer script. It's autmattically defaulting to the else.

[Code]...

View 2 Replies View Related

General :: Make A Bash Script Ask For A Specific Key?

Nov 21, 2010

I am attempting to learn how write bash scripts. I want one to ask for a specific key. For example, I want it to ask a question, then if it is like, y for yes, or n for no, it does a specific thing. I'm thinking it would be something like:

Code:

#!/bin/bash
echo "Are you a boy? y/n"
read -t3

View 14 Replies View Related

General :: Make A Bash Script Into A Daemon

Aug 7, 2011

i've written a script that will move some files from one directory to another, i dont know if this is the right place to ask but, this is on my ipod touch and i'm wondering how to make it run periodicaly

View 6 Replies View Related

Programming :: Make Bash Replace The Value Of A Variable?

Apr 18, 2009

I have a program I am writing where I have a for loop and I want to make it substitute the variable twice like:

for ((i=0;i<5;i++)) do
echo $"$i"
done

[code]...

View 3 Replies View Related

Fedora :: Make BASH Script Wait For A Few Minutes?

Nov 26, 2009

I'm using bash script now,and I want have a script that can do like this: first ,tell me it will shut down ,and then shut down.My script looks like this:

#!/bin/sh
/usr/bin/curl $stop_page
shutdown -h now

[code]...

View 4 Replies View Related

General :: Make Bash And It's Apps Automatically Resize?

May 29, 2011

I'm working in Debian, and I've noticed that when I resize my PuTTY window, the console inside isn't resizing to the new dimentions, so things like nano are running at 80xwhatever instead of the more useful 130xsomething that I've offered it.

View 2 Replies View Related

Programming :: Make A Automated Build-script With Bash?

Apr 14, 2010

I'm trying to make a automated build-script with bash but i keep getting different errors that I can't seem to figure out. Could anyone please tell me what's wrong with this package of build-scripts? I'm posting the main build-script and attaching the rest of the scripts in a compressed form. The errors mainly comes from the scripts in "/first_installation/usr/share/siem-live/init"

[Code]...

View 2 Replies View Related

Software :: Make Craig's List Ad Notifier In Bash?

Jan 7, 2010

I have OpenSuSE 11.2, and I am learning Bash scripting. I was wondering how I would make a bash program, That I could have it check multiple craigslist sites [western mass, worcester mass, etc], e.g. in the Free category, and/or enter keywords, and have it update every 5 minutes, and then post the results somewhere, to a file, or even upload it to a server, or if it's even possible? (Kind of like the program "Ad Notifier for Craigslist") Would I have to do this in C/C++? If it has to be done in C/C++ It would have to be windows compatible preferably.

View 2 Replies View Related

Software :: Make Ctrl + Backspace Work In Bash?

Jan 18, 2010

I've tried without luck to get ctrl-backspace working to delete the previous word in bash. I edited my .inputrc and tried the following:

"C-": unix-word-rubout
Control-Rubout: unix-word-rubout

I can make it work if I change it to some other sequence (Control-j: unix-word-rubout makes ^j erase the word), but I can't make it work with backspace.

View 6 Replies View Related

Programming :: Bash : How To Make Firefox Open But Minimize

May 3, 2011

I am relatively new to scripting, but I was wanting to open a firefox window from a bash script, but have it open, then minimize. In the script, I have a single instance of: firefox & but is there a way to minimize it, versus have it displayed on the screen? I was wanting the command terminal to remain visible and it can't since the firefox window is open in front of it. I looked all over the place, including the man pages, but to no avail. I can make the height and width changes, but no minimize. Either that, or to be able to bring the terminal window back to the front automatically.

View 5 Replies View Related

Programming :: Make An Automated Build-script With Bash

Apr 14, 2010

I'm trying to make a automated build-script with bash but I keep getting different errors that I cant't seem to solve for various reasons. what's wrong with this build-script? I'm posing the main build-script and attaching the rest of the scripts in a compressed form. Buld-script link: [URL]

[Code]....

View 3 Replies View Related

Programming :: Make 2 Separate Arguments In 1 Bash Script?

Aug 31, 2010

This is what I have:

Code:
#!/bin/bash
#ascript.sh

[code]...

View 8 Replies View Related

Programming :: Make A Flawless Bash Alarm Script

Jan 12, 2011

I am not positive that this is the right subforum for this post. It is technically a programming question but I am not sure if this is the best place for bash scripting questions. Anyhow, I have been having trouble getting up in the morning. I am a pretty good morning person and once I am up, I am good to go. The problem is getting out of bed. Traditional alarms have just not cut it in the past; there is always an easy way to shut them off and go back to sleep.

Recentliesh, I decided to try to make an alarm script in bash that would be more successful in getting my lazy behind out of bed. I am a newbie bash scripter at best so my attempts have been very simple but have not cut it so far. Here are some examples:

[Code]....

The above script was the version of my bash alarm. It will not stop ringing until I input that ridiculous phrase. The big issue with this script was that I would input the phrase quickly and go back to sleep. It was however, much more successful than traditional alarm clocks. Another obvious pitfall was that even though control-c'ing the process would not work, the terminal could be closed and that would be the end of it. I'll get back to that issue. Here is my second attempt:

[Code]....

View 7 Replies View Related

General :: Make Simple Website In System Using Bash Scripting?

Apr 3, 2011

How to made a simple website in linux using bash scripting.

View 3 Replies View Related

Programming :: Write A Bash Script That Will Make Some Web Stats Reports

Jun 23, 2010

I'm planing to write a bash script that will make some web stats reports and I'm stuck on beginning because I don't know how can I read a directory content, put everything in a variable, compare the variable value with current date and go further.More specific ...

I have /var/apache/log/. Here I have access logs on date ( like access.log.24.06.2010.gz and so on ).

How can I do to automatically zgrep (in a bash script) last day .gz ??

View 3 Replies View Related

General :: Make A Bash Script That Automatically Delete The Home Folders?

Feb 15, 2011

I am administrating a lab in a university and every semester we need to delete all the home folders of the accounts for the next semester. I would like to make a bash script that does this automatically and having trouble with it. Note that I am writing my very first bash script. What I need to do is make a script to delete the following:

Delete everything in /home/$exp$num/$dir
when "exp" could be either "rt", "ic" or "sp".
"num" could run from 1(single digit) to 45 and dir is "profile" and "work".

This is what I tried to write:

Code:

#!/bin/sh
cd /home
for exp in "rt ic sp"
do

[code]....

What seems to be the problem is the reading of "$exp$num" as a joint expression.

View 4 Replies View Related

Programming :: Bash - Ps - Psgrep And Read /proc/$pid Make Script Exit

Mar 22, 2011

I have not been able to write bash to use a PID file to ensure no other instance of the same script is running! All three methods I can think of to see if the PID in the PID file is another instance of the script make the script exit with a return code of 1 but the same commands run at the command prompt work as expected.

The first attempt was:

Code:

The first attempted workaround was:

Code:

The second attempted workaround (with debug to make the following command prompt copy and paste meaningful) was:

Code:

Here's the command prompt session, testing with a stale PID file and then manually running the problem command and it behaving as expected:

Code:

This on Slackware64 13.1 which has bash 4.1.7.

In desperation I tried rebooting but the behaviour was the same.

View 2 Replies View Related

Programming :: Make A Bash Script That Will Open Up Port 23 For A Netcat Connection?

Apr 14, 2009

I'm starting to like making bash scripts. It's kewl making creative ones. Right now I'm trying to make a bash script that will open up port 23 for a netcat connection. Once there's a connection, I'd like for the script to open up xmms and play a sound effect, as well as echo a txt file to the desktop saying that a connection was made at this specific time. When I execute the script, it stops exection at the first line. So far I have this:

sudo nc -lvnp 23
while [ 1 ]
do

[code]...

View 8 Replies View Related

Programming :: Make A Bash Script Start Automaticly When System Restart?

Apr 4, 2009

ia have this script
#!/bin/bash
if [ -e /tmp/mysql.pipe ]; then

[code]...

View 3 Replies View Related

Ubuntu :: Renaming Files Through Bash

Feb 10, 2011

I'm trying to rename ~11000 files. What has happened is I have files in the following format:

string1_100_string2_200_string3_300.log

now the numbers 200 and 300 are sometimes below 100 and the file looks like this:

string1_100_string2_99_string3_99.log

and I want to rename such files to be like this:

string1_100_string2_099_string3_099.log

I wrote a small matlab script but it seems to take forever so thought I'd try and do it bash and have got near to nowhere....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved