Programming :: Tar *.gz/.bz2 Extraction - Deploy With Bash Script

Apr 5, 2010

I thought of a command that would make my life easier, though I do not know how to deploy it with bash script. The idea- A simple script that would check in a the current directory for *.bz2 or *.gz files,and when finds one of those,or both - execute a tar -xvf *.bz2/*.gz following the files that have been found there. It should be very simple,as I am very new to bash,I can`t figure that out. I wrote :

[Code]....

The idea ls command that would find *.gz files in the current dir,then it outputs the errors to ./tmp.txt, if there were no errors = a tar.gz archive found,tmp.txt will be blank,hence the cat command that checks the file. The wrong - I couldn`t succeed with the "cat 'tmp.txt' == '' ;" ,as cat command searches == as a file and it fails.

View 5 Replies


ADVERTISEMENT

Programming :: Bash Regex String Extraction?

Jun 10, 2011

Code:
g echo ${mm[$j]}
4 BashNotes

[code]...

View 2 Replies View Related

Programming :: Substring Extraction - Bash Gives "bad Substitution" Error

Jul 16, 2010

I'm trying to use ${VAR:0:4} substring extraction described here: tldp.org/LDP/abs/html/string-manipulation.html and it works perfectly if i issue a command in bash. But when i put it in a script file and run it, bash gives me "bad substitution" error. Does anyone know how to fix it?

View 5 Replies View Related

Programming :: Multiple Line Pattern Matching And Variable Extraction?

Oct 19, 2010

I have this complex log file filled with entries like

test1-G1/0/0-100-QOS-7001923-ROUTING (ClassMap)
Action: Resolved New
sysName: test1.local

[code]...

View 1 Replies View Related

Programming :: Bash: Printing The Line Number In Bash Script?

Feb 4, 2011

I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.

View 3 Replies View Related

Programming :: Bash Ctrl+c Tarp And Bash Read With Timeout?

Jan 24, 2010

simple bash code:

Code:
#!/bin/bash
trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c
echo "Press ctrl+c during 5 sec loop"
for ((i=0;i<5;i++)); do

[Code]...

How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!

View 10 Replies View Related

Programming :: Reading A Bash Variable In Bash Scripting ?

Nov 26, 2008

I have a config file that contains:

my.config:

Code:

Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.

Here is my parse_cmd script:

Code:

View 3 Replies View Related

Programming :: Run Multiple Bash And Php Scripts From A Bash Script?

Jul 25, 2011

I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.

Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?

View 5 Replies View Related

Programming :: Bash: Get Filename And Extension Using Bash?

Jan 9, 2010

I would like to get the filename (without extension) and the extension separately. The best solution I found so far is:

Let FILE="thefilenameofsomefilesfor_instance.txt"

Code:

NAME=`echo "$FILE" | cut -d'.' -f1`
EXTENSION=`echo "$FILE" | cut -d'.' -f2`

I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.

View 5 Replies View Related

Software :: Can't Do Extraction Using Tar Command

Jul 9, 2010

I am able extract the file "hurd-live-cd-20051117.iso.gz" using file-roller but i cannot do it using tar command ,i gave the command tar -xzvf hurd-live-cd-20051117.iso.gz although it exited without error the file is not extracted what is the correct options to use to extract the file?

View 5 Replies View Related

Programming :: Bash Programming - Rename Files In A Loop?

Mar 31, 2011

I need to rename the resulted searched files from a loopI have the following code:

find . -name DOC* | while read i
do
find $i -type f -name '*.txt'
done

basically, I am searching for all txt files inside any folder starting with DOC name.this code is working fine with me.I need to rename those .txt files to .txtOLDOS: Ubuntu 10.4Bash shell

View 10 Replies View Related

General :: Which Directory Mpc / Gmp / Mpfr Store After Extraction

Feb 20, 2011

I'm trying to do a linux from scratch build (using the livecd) and am currently trying to compile and install gcc. However, this error keeps popping up: checking for correct version of gmp/mpfr/mpc libraries...no I've tried all the possible directories I can find for each one, but as the error doesn't specify which particular library it can't find it makes life pretty difficult =/ This is my current string:

[code]....

It took me long enough to find the .h files and I thought it was finally over with, but now this

View 2 Replies View Related

General :: Assigning New Creation File Time On Tar Extraction?

Nov 19, 2010

How I can tell tar to assign a new creation date to extracted files? Let's say I have an archive filled with old files of varying ages. Upon extraction I want all files to have the same time stamp (that of the time of the extraction).

View 1 Replies View Related

Ubuntu Security :: Prevent Kernel Initramfs Extraction?

Jul 16, 2010

I'm writing here because it's mainly a security issue even though it's rather kernel related.

I'm compiling my own vanilla kernel with an initramfs included in the bzImage. That image contains encryption keys for the rest of the system. Even though it's not for everybody the initramfs image can be extracted from the kernel, decompressed and the keys extracted.
I'm looking on a way to prevent this.

View 3 Replies View Related

Ubuntu Multimedia :: Batch Extraction Of Subtitles From Mkv Files?

Jul 16, 2011

I have recently been tasked to extract the subtitles from a lot of mkv files. Hundreds of them, maybe even more than a thousand. To do this, I modified a script I found online:

#!/bin/bash
IFS="|"
if test -z $1; then

[Code].....

So in the above example the subtitle is actually in track number one and my script would be borked for that particular file. Is there a way to integrate mkvinfo into the script and parse it to see what track should be extracted? Like, read it line-by-line and change the value of some #TRACKNO variable everytime a string like "| + Track number:" appears, and stop when a string like "| + Track type: subtitles" appears? Maybe even skip doing anything if there aren't any subtitles.

PS: I actually prefer SRT subtitles to ***. If there was some command line tool I could use to convert the resulting *** file to SRT I would be much obliged.

View 2 Replies View Related

Red Hat / Fedora :: Easy And Reliable Way To Install *.tar.gz Package After Extraction?

Feb 6, 2010

Fedora 12 64bit

Is there an easy and reliable way to install *.tar.gz package after extraction? Instead of going through ./configure etc.

View 2 Replies View Related

Debian Multimedia :: Mplayer Audio Extraction From Video Files

Dec 9, 2010

I am on Squeeze. In the past I have successfully extracted audio from video files. Recently when I try it I get an unplayable file, just some brief noise nothing more. Mplayer on the other hand plays every video and audio file out there. Is there something wrong with mplayer? I installed mplayer from the repo. I haven't compile mplayer since before Lenny.

View 14 Replies View Related

Ubuntu :: Virtual Box - Extraction Failed Zunesetup.exe Is Not A Valid Win 32 Application

Sep 4, 2010

I have sun virtualbox so I can install the zune 2.0- software on XP.... for some reason when I install the program... a box comes up and says extraction failed zunesetup.exe is not a valid win 32 application....

View 1 Replies View Related

Red Hat / Fedora :: .bin Extraction Error Unable To Create Temporary Files

Jul 12, 2011

It is saying to make sure there is enough room in the tmp folder, so I cleaned out the entire tmp folder but the same error is still happening. Is there a way to make the tmp folder bigger? Or perhaps extract the temporary files to a different folder? Or maybe the size if the tmp folder is not even the problem?

View 1 Replies View Related

Networking :: NETFILTER And Extraction Of Data From Non Linear Area Of Skbuff

Feb 25, 2011

i am writing a netfilter module for linux 2.6.34.6-47 / 2.6.35. while i could capture the packets on the incoming hook since the same came as a single packet in probably the allocated skbuff area by the stack, i found that packets going out of the machine are getting splitted into linear and non-linear area. skb->data gives the total length of packet as correct, but when i extract skb-> data to print it, it prints only ip and tcp header. Now to treat the data i need to extract it and then push it back on the route.

To clarify if my data is 3 bytes . the total length by passing pointers show as 55 bytes = ( 52 byte of header + 3 byte of data), but i can't access these 3 bytes by using skb->tail - skb->data. how to extract outgoing data for any further action and then put it back on route for further encapsulation by the L2 stack or whatever. will skb_linearize() or skb_linearize_cow() be of any use , if yes how and why?

View 1 Replies View Related

CentOS 5 :: 3rd Party Software Installation - Tar Extraction Permission Denied

Jun 10, 2010

I have 3rd party software that I need to install. It is called VNMRJ. It is packed as one .tar. I extracted the .tar to the desktop (under root) and want to start the installation. However, during the installation process, all .tar files included the the package (sub directories) can't be extracted by the installation routine. For every .tar I get the error

tar: /root/Desktop/vnmrj21b_inova_01106/code/common/com.tar: Cannot open: Permission denied
Installation of VNMR failed
tar: Error is not recoverable: exiting now
DONE: 112 KB

View 5 Replies View Related

Ubuntu :: War File Won't Deploy

Oct 3, 2010

I have a warfile at /home/myusername/webapps/website.war and the following on /etc/tomcat6/Catalina/localhost:

Code: <Context path="/ROOT" docBase="/home/myusername/webapps/website.war" /> It's not deploying, why?

View 1 Replies View Related

Ubuntu :: How To Image And Deploy 11.04

Jul 1, 2011

I work for an independent school where most of our computers run Windows 7 and Mac OS X. I've started installing Ubuntu (11.04) on some of our older machines, thus introducing Linux to our environment and recycling computers which would otherwise be candidates for the garbage truck. While I am familiar with imaging and deploying Windows and Mac OS, I am lost when it comes to Linux. I have set up a computer with all of the settings and applications that I would like the other computers to have. how can I image that reference machine and then transfer that image onto another PC?

View 9 Replies View Related

General :: How To Deploy Fedora In Wds

Jan 26, 2011

how to deploy fedora in wds..it for my last final project..

View 8 Replies View Related

CentOS 5 :: Deploy VPS On Server?

Nov 24, 2009

i use CentOS5.4, i want to deploy VPS on my server. Which technology i can use: OpenVz or Xen?

View 2 Replies View Related

Programming :: Write A Bash Script That Sources Another Bash Script?

Jan 29, 2011

I am trying to write a bash script that sources another bash script. Essentially, I need a few lines to check to see if a certain variable is set. If not, I set it manually, and then source a scripts with that variable in the path. I wrote a test script to try it, but for some reason the last line does not work. Here is what I wrote:

#!/bin/sh
source ~setupdir/setup.shrc #just a test, this line works
echo ${#SETUP} # prints 0 if setup is not set, which it isn't
if [ ${#SETUP} -eq 0 ]
then
SETUP="~setupdir"
fi
echo $SETUP # prints ~setupdir

[Code]...

View 5 Replies View Related

Ubuntu :: Iso File Extraction - Go Through 3500+ Rom Files And Delete Added ;1 To Nes Extension

Aug 15, 2010

I downloaded an ISO of some nes roms and used the archive manager to extract the files. It extracted them but it added a ;1 to the end of the extension. I don't want to go through 3500+ rom files and delete the added ;1 to the nes extension. How can I prevent this in the future?

View 3 Replies View Related

Ubuntu Servers :: Deploy ACL U9.10 Server?

Mar 1, 2010

I would like to know how to deploy an ACL (ACCESS CONTROL LIST) on Ubuntu 9.10 server, because "apt-get install acl" is not responding.

View 2 Replies View Related

General :: Deploy A Package On Many Systems?

Feb 23, 2010

how would you automate install/upgrade to a package to 200 servers. and obviously not by going to each system physically.

Answer: NFS share , using perl script and rpm utility. But i have not done such kind of install/upgrade so my knowledge is limited.

but i want to know how would i do that on Redhat Enterprise or CentOS.

View 3 Replies View Related

Software :: Deploy A New Network With PCs And Servers?

Jan 30, 2011

We are going to deploy a new network with PCs and servers. until here, Windows was choosen. However, because of legacy applications, Linux is now chosen. Therefore, I am looking for something to replace Active Directory. I know there are software for eacho prupose (BIND for DNS, But I would like to have a central tool with integration between services as Active Directory can provide.

The services I need are:
- DHCP
- DNS
- Directory for central authentication (workstations are not on stand alone)
- File shares
- Binary repository for upgrade (as WSUS on Windows)
- NTP

View 11 Replies View Related







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