General :: Removing Subdirectorys And Only Working With Files (Bash Cookbook 5.8)?

Jul 6, 2010

The Cookbook gives us

for FN in $*
do
echo changing %FN
chmod 0750
done

but that changes all. how can I change all files but subdirectorys? I was thinking of something likels -l | grep -v ^d but can't get it to work. I'm still learning about variables and how to use them. thanks in advance for your Patients.

View 2 Replies


ADVERTISEMENT

General :: Bash Scripting - Removing Strings From MP3 Filenames

Oct 5, 2010

I've been surfing and searching the net quit a while now to make my own script, but I haven't been really successful ever since I want to make a script which can remove strings from my mp3 collection (file names).

For example:
Code:
101-bob_sinclar_feat_sean_paul-tik_tok_(radio_edit).mp3 --> bob_sinclar_feat_sean_paul-tik_tok_(radio_edit).mp3
10-Young Jeezy-Lose My Mind (78 Bpm) (Repack).mp3 --> young_jeezy-lose_my_mind.mp3

Now the problem is how can I remove the strings like:
101 & 10 (dynamic)
(%%% Bpm) (dynamic)
(Repack) (static)

View 11 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

General :: Removing Files Or Directories Recursively

Jan 29, 2010

The rm command man pages discusses removing files or directories recursively. So what is meant by deleting a file or directory recursively? And what are some reasons for doing so?

View 3 Replies View Related

General :: Removing Files From GRUB LOADER

Apr 27, 2010

Does anyone knows how to remove files from grub loader.BTW i found some tutorials but they don`t seem to work.I`ve tried Alt+F2 then I`ve edited this command: gksu gedit /boot/grub/menu.lst but it doesn`t seem to work what do I do?

View 5 Replies View Related

General :: Removing Glib 2.20 An 2.26 / Where Files Located?

Oct 17, 2010

I have stuffed up my system and I want to remove Glib 2.20 and Glib 2.26. How can I do this? Where are the files located? Sadly, there does not seem to be a make uninstall file for Glib.

View 3 Replies View Related

General :: Script For Removing Files Depending On Age?

Jun 6, 2011

I want to develop a bash or Perl script that will evaluate files in the local directory and delete every file that is older than a specified time period, such as three months.I write documents and save the latest modifications by putting the current date in the filename, so I can easily see which versions are the newest. I would like to clean up my directory every once in a while, though, by eliminating the copies that are more than a few months old.

View 14 Replies View Related

Fedora :: Create A Recipe Cookbook In OpenOffice 3.3?

Dec 9, 2010

HOWTO: Create a Recipe Cookbook in OpenOffice 3.3 This HOWTO: will guide you through the process creating a Recipe Cookbook in OpenOffice 3.3.

PREWORK: Before staring to type in all your favorite recipes, and formatting each section of text, there are a few decisions that will affect your layout. They are:

1. Paper Size: 8.5" x 11", 8.5" x 14", or 11" x 17"
2. Binding: 3 Ring or Spiral
3. Columns per Sheet of Paper: 2, 3, or 4

[code]....

I chose 8.5" x 11", 3 Ring, 2 Columns, TimesNewRoman, Portrait, and Double Sided. These choices specify two recipe pages on each side of a sheet of paper, making a total of four recipe pages printed in some specific order on one sheet of paper to create a Recipe Booklet. I prefer a 3 Ring Cookbook to the Spiral Bound versions as the 3 Ring version pages don't get mangled. The separator line down the center of the layout may be used for manual cutting the sheets when you are finished printing. Your decisions may vary from mine, making your layout different depending on your test printing results.

LAYOUT THE COLUMNS:

Formatting a Single Sheet of Paper in OpenOffice 3.3:

FORMAT -> PAGE -> 2 COLUMNS

SPACING 1.30" with a Separator Line of NONE (This is because my Brother HL-2140 doesn't print them equal side to side) This will give you an area for each page (Left & Right) on each side of the Sheet of Paper. It is within this area that your text will be formatted according to your planned layout. Use recipe1.png & recipe2.png below to assist you in laying out your design. Once your 8.5" x 11" sheet has the proper layout save the file.

ADD/DELETE PAGES: Open your layout and keep the "enter key" depressed to create the needed pages. Likewise move your cursor to the last row in the last column of the last sheet and keep the "delete key" depressed to remove the extra pages. Save your file.

CALCULATING PAGE LAYOUT ORDER:

Since each Sheet of Paper may contain 4 printed pages, the total number of pages CREATED in OpenOffice 3.3 needs to be a multiple of FOUR. For example, I typed in 104 pages in OpenOffice 3.3 and this will create 26 ODD Pages and 26 EVEN Pages. For my Recipe Book the page order was:

ODD

104,1,102,3,100,5,98,7,96,9,94,11,92,13,90,15,88,1 7,86,19,84,21,82,23,80,25,78,27,76,29,74,31,72,33, 70,35,68,37,66,39,64,41,62,43,60,45,58,47,56,49,54 ,51

EVEN

2,103,4,101,6,99,8,97,10,95,12,93,14,91,16,89,18,8 7,20,85,22,83,24,81,26,79,28,77,30,75,32,73,34,71, 36,69,38,67,40,65,42,63,44,61,46,59,48,57,50,55,52 ,53

[code]...

View 1 Replies View Related

General :: Cluster Not Working After Removing Network Cable?

Mar 16, 2010

We were moving our cluter and during this process eth1 cable(external internet cable) was pluged-out. After pulg-in that wire again cluster is not working nicely and some process including mysql is not working.

View 12 Replies View Related

General :: Removing Quotes When Dragging Files To Terminal

Feb 18, 2010

The following script will work when I type the path to the file I want to checksum, but not when I drag the file to the terminal because the linux terminal (unlike the Mac) automatically puts quotes around the file path, which causes an error. I did not find anything in gconf-editor or anywhere else to alter this behaviour, and my post in Launchpad is unanswered so far. (the script in itself is not very useful, I just stumbled upon this error when experimenting with bash).

So, is there a workaround for stripping the quotes from the input, or can I configure the terminal to not quote the input when I drag a file into it (which I would prefer?)I am currently logged in from Mac OS, but the question refers to ubuntu karmic with which I dual boot.ADMINISTRATORS: Thanks for the quick reply to my newbie question about posting new threads. Actually I don't see now what the difficulty was; I guess I was tired from trying to debug the above script (not funny).

View 1 Replies View Related

Programming :: Bash Removing String From File?

Aug 7, 2010

I am trying to remove everything before my string code...

View 9 Replies View Related

Programming :: Bash Output With Timestamp Removing Duplicates

Nov 20, 2010

I'm writing a bash script to auto run on boot in Tinycore.

This is a watered down version.

Code:

I need it to either not add the time stamp if the awk finds a duplicate or write over the time with the new time if awk finds a duplicate.

BTW this is all pretty much cut-and-paste scripting so please feel free to comment if you know a more elegant way.

View 3 Replies View Related

Ubuntu :: Bash Script - Removing Windows Return Characters

Sep 1, 2010

I've got a basic script, which parses data from a text file and performs actions based on that data. Here is my code:

Code:
dsrc="/home/russellm/sites/"
ddst="/home/russellm/othersites/"
while read SiteID
do
if [[ ! -d "$ddst${SiteID:0:1}" ]]
then
mkdir "$ddst${SiteID:0:1}"
fi
mv "$dsrc${SiteID:0:1}/${SiteID%*}" "$ddst${SiteID:0:1}/" | tr -d '
' done < sites.txt

The text file came from a windows system, and contains those return characters (). I 'could' just run the whole thing through tr and then run the script on the new data file, but I'm looking for a more elegant solution. As the code above shows, I'm trying to pipe the mv command though tr in order to remove the return character - but it's not working. I can't get this to work with sed either, so I know I'm doing something wrong. I also tried to remove it using ${SiteID%} - but that also failed. The characters don't show up in an echo, just when executing a command.

Output example (emphasis mine):
Code:
mv: cannot stat `/home/russellm/sites/B/B23467324
': No such file or directory
I'm tempted to just convert the file once and call it a day, but you know what it's like. To be honest, I'm starting to suspect that there are no return characters, and that I'm going about this wrong.

View 4 Replies View Related

General :: Writing In Bash While It Is Working?

May 6, 2011

When you are performing time consuming operations in bash like installing new software, is it possible to write text that will appear at the prompt when the operation has finished.

E.g

Imagine running:

apt-get install eclipse-platform

Then it will use quite a while to finish while you see the installation log, meanwhile I want to create new folders (workspaces) which Eclipse later will use.

Is this possible without opening a new terminal (or tab)?

View 5 Replies View Related

General :: Scp Is Not Working With Restrict Bash?

Apr 21, 2011

I just wondering if scp working with restrict bash ? It seems like my scp just stuck there while login.

If i use ftp i get 530 login failed..

View 1 Replies View Related

General :: Bash For Loop Not Working?

Apr 21, 2010

I have bash 4.0. I used the following for loop example, but all it outputs is "{1..10} instead of the actual numbers one through ten. why?

Code:
for a in {1..10}
do
echo -n "$a "
done

View 5 Replies View Related

General :: Error Propagation Not Working In Bash

Mar 14, 2011

when ever some error happens in the functions, they are not propagated and err_out function is not called.I tried #!/bin/bash -E too; that way when there is an error the script exits but what I need is error to be propagated properly to the handler.

View 1 Replies View Related

General :: Commands See Files, Bash Doesn't?

Sep 10, 2010

This is a really odd bug I can't seem to figure it out. Basically, commands like ls can see all the files in the current directory, however when I go to execute the file it will give errors like "file not found", even when it most obviously is. If you look at my command history in the screenshot, you can see I can ls into a directory and see it's contents. When I try to run the file, I get the "no such file or directory" error.

However, if I type simply 'vm', I can't use tab completion to complete the directory name, and my third command is me typing 'vm' and hitting tabtab, it lists a bunch of vmware specific tools instead of the subdirectory name. I can then ls and see my current directory contents, and it will list only the single subdirectory. However, then I tried to use the full filepath from root to run the file, still to no avail. If anyone has any insight,

View 2 Replies View Related

General :: Bash: Find Folders With Less Than X Files?

Sep 18, 2010

How would I go about finding all the folders in a directory than contain less than x number of .flac files?

View 2 Replies View Related

General :: Bash Command To Count Files ?

May 3, 2010

I would like to count all the jpgs in my home folder I need a command like this:

~$ Sudo count -R /*/*.jpg

View 3 Replies View Related

General :: Script In Bash - Compare Two Files Name

Mar 7, 2010

I want to compare 2 name files, for instance. I got the package foo1.tgz and the foo2.tgz. and I want a script in bash that detects foo2 is newer than foo1 and delete foo1. Can it be done for managing collection of slackware packages.

View 2 Replies View Related

General :: Comparing Files In Bash Script

Sep 2, 2010

I want to compare two files and display values unique to file1. I tried using comm but it did not give me useful outputs.

comm -2 -3 file1 file2 does not work

Similar threads provide matched content. What I am looking for is unique content.

View 9 Replies View Related

General :: Word Search In Files Using Bash?

Oct 9, 2010

I'm trying to use Bash to search some directories for a word in one of documents. I've tried:

Code:

$ grep -R Brzeninski /media/disk-1/Dual_Data/

but It never returned a prompt, and i'm not sure what grep means or does.

View 1 Replies View Related

General :: Echo Newline Character Not Working In Bash?

Mar 11, 2011

I have bash script which has lots of echo statements and also I aliased echo to echo -e both in .bash_profile and .bashrc, so that new lines are printed properly for a statement like echo 'Hello World' the output should be I even tried using shopt -s expand_aliases in the script, I am running my script as bash /scripts/scriptnm.sh; if I run it as . /scripts/scriptnm.sh I am getting the desired output.

View 4 Replies View Related

General :: Find The Bash Source Files Of Programs In Mac OSX?

Jan 6, 2011

I am currently writing some convenience methods for my terminal in my bash_profile and am sure if what I am writing is "the best way". I figure a good way to verify whether what I'm doing is right or not would be to find some source code of more established programs and see how they do it.My question then is, where can I find this code on my Mac? An example is, with Macports installed, where is the source code that opens the port interactive console when I type nothing but "port" in my shell?(I added Linux in the title even though I am on a Mac because I assume the answer would be the same for both)

View 3 Replies View Related

General :: How To Get List Of Files Not Matching Patterns In Bash

May 4, 2011

I have a file with joker character patterns:
./include/*
./src/*
etc.
From the current directory I would like to recursively get the list of files that do not match these patterns.

View 2 Replies View Related

General :: Bash - Compressing Files Despite Low Disk Space?

Jul 18, 2011

I use Linux. I coded a screenshot program some time ago and now I have 9 GIG of screenshots, 60000 JPEGs, most of them look pretty similar, and I have 300 MB of disk space remaining.

What are some good ways to start to compress batches of them (or all of them) in the background given the limited space? The problem with compressing the folder all at once is that I wouldn't have enough disk space for that. It seems the process needs to be broken down into chunks. So maybe something like: Get a list of all the files Add a chunk of the files (say, 20) to a compressed archive. Once it is done and saved successfully, delete the chunk of files

View 2 Replies View Related

General :: Bash Script To Rename (renumber) Files?

Jan 27, 2010

I'm trying to write a script to process some images and rename them, or more specifically, renumber them so that pg_0001.png becomes pg_0.png, pg_0002.png becomes pg_1.png, etc. I've looked at the rename command and sed, but I'm not really very familiar with these. It should also be part of a bash script that I've written for the processing of these files - this is what I have so far:

Code:
#!/bin/bash
pdftk 2012 theatre Sep 2009.pdf burst

[code]...

View 5 Replies View Related

General :: Bash Script To Convert MPG Files To AVI Format?

Sep 19, 2009

I'd like to write a bash script to convert all of the .mpg files in a directory to .avi files. The ffmpeg part of this produces the kind of file that I want, but rather than changing the name of the input and output files each time that I run the script, I'd like to automate it. I've tried this script, but I get an error "command not found".

#!/bin/bash
cd /home/michael_s/golf_temp
1 for i in 'ls *.mpg' ; do
/usr/bin/ffmpeg.exe -i /home/michael_s/golf_temp/"$i" -map 0:0 -map 0:1 -pass 1 -vcodec mpeg4 -vtag xvid -f avi -b 1100k -vol 384 -mbd rd -s 640x480 -aspect 4:3 -acodec libmp3lame -ac 2 -ab 128k /home/michael_s/golf_temp/"$i".avi

rm -f /home/michael_s/golf/temp/"$i".avi
/usr/bin/ffmpeg.exe -i /home/michael_s/golf_temp/"$i" -map 0:0 -map 0:1 -pass 2 -vcodec mpeg4 -vtag xvid -f avi -b 1100k -vol 384 -mbd rd -s 640x480 -aspect 4:3 -acodec libmp3lame -ac 2 -ab 128k /home/michael_s/golf_temp/"$i".avi
done
fi
quit

View 5 Replies View Related

General :: Find Duplicate Files Using Bash Script ?

Jun 8, 2010

What kind of method to find the duplicates files on linux,

1.how to find just using the file name, sometimes i figure out people often to copy their files to another directory and i want to find out if there any same file name in the linux box.

2. what about if i want to find the duplicate files based on contents of the file, example is in picture file if users store picture files from digital camera first they just save the file name in default but when they want to give that picture to others they will rename it, i've been used method md5 for this situation in python script but it takes long time

I'm asking this question just to know to use bash script a lot in work and i want to test out fdupes at home, is fdupes use similar md5 scan to find duplicate files?

View 4 Replies View Related







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