LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 02-26-2013, 12:11 AM   #1
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Rep: Reputation: Disabled
Problems trying to extract gzipped archives from script


ose.tar.gz: command not found
build.tar.gz: command not found
how to overcome this error? I am totally new to linux.
 
Old 02-26-2013, 12:34 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Those are data files, not cmds.
What exactly are you trying to do?

You should read this
http://rute.2038bug.com/index.html.gz

Can you tells us the name of your Linux version?
Please post the results of
Code:
cat /etc/*release*

uname -a

df -h
 
Old 02-26-2013, 01:18 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
These are archived files (or a collection of zipped files). Tar stands for tape archive and gz for gzip.
These files were created as:
Code:
~$ tar -cvf ose.tar /path/to/source
~$ gzip ose.tar
So in order to check it's content, use:
Code:
~$ tar -ztvf ose.tar.gz
To open/extract it:
Code:
~$ tar -zxvf ose.tar.gz
OR
~$ gunzip ose.tar.gz
~$ tar -xvf ose.tar

Last edited by shivaa; 02-26-2013 at 01:20 AM.
 
Old 03-05-2013, 12:41 AM   #4
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanku

Thanku for the reply

I have another problem. I am totally new to linux. I have been given one document and in that the paths are like this i.e./home/cdot/c4/ose. My mam has asked me to replace the path i.e. /home/cdot/ with some variable. How could I do this?

Thanku
 
Old 03-05-2013, 12:55 AM   #5
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 50
Code:
$ var=/home/cdot
where var is a variable, it could be anything.
if you call the variable using echo, the output is what you have stored in the variable, right now it is path.
Code:
$ echo $var
output
Code:
/home/cdot
You can use $var instead of /home/cdot in your script
 
Old 03-05-2013, 01:11 AM   #6
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanku

Thanku for the reply but still its not working.
Here is the error which i am getting.
./script: line 11: /home/cdot/c4/ose/site: is a directory
./script: line 12: /home/cdot/c4/ACE_wrappers/TAO: is a directory
./script: line 13: =/home/cdot: No such file or directory
[root@hpv2k-57 c4]# pwd
/home/cdot/c4
Thanku
 
Old 03-05-2013, 01:22 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Do you want to replace /home/cdot/ string with some variable...?

Code:
~$ sed -e 's/\/home\/cdot/<some_value>/g' infile.txt
OR
~$ gawk '{gsub(/\/home\/cdot\//,"<some_value>",$0); print $0}' infile.txt
Where, <some_value> is what you will replace /home/cdot with.

Last edited by shivaa; 03-05-2013 at 01:26 AM. Reason: Typo
 
Old 03-05-2013, 01:26 AM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Probably best if you show us the script and be clear on what you want to see before and after.
 
Old 03-05-2013, 01:26 AM   #9
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I have been given one code and I have been asked to grep /home/cdot/c4 path in the code. Some where in the Makefiles this path is hardcoded. I have to find those paths and document it. Then I
have to replace those path with the variable where one can specify the path from my
script. I am unable to do dis.

I have found the path and it is
OSE_ROOT=/home/cdot/c4/ose and the other path is
export OTCommon_ROOT=home/cdot/c4/core/common

I have to replace only home/cdot with the variable.
Thanku
 
Old 03-05-2013, 03:41 AM   #10
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanku chris
This is the kind of script. Its not the exact script
My mam has asked me to search for the path /home/cdot/c4 nd replace /home/cdot with some variable so that it could be assessed by that variable instead of the directory.
export ROOT=`pwd`
export ACE_ROOT=$ROOT/ACE_wrappers
export LD_LIBRARY_PATH=$ACE_ROOT/lib
export TAO_ROOT=$ACE_ROOT/TAO
export PATH=$PATH:/$ROOT/build
gunzip ose.tar.gz
tar -xvf ose.tar
cd $ROOT/ACE_wrappers/ace
ln -s config-linux.h config.h
cd $ROOT/ACE_wrappers/include/makeinclude
ln -s platform_linux.GNU platform_macros.GNU

cd $ROOT/dc/jobs/unix
chmod +x bldsixax
./bldsixax release

mkdir $ROOT/core/UCA/release/lib
mkdir $ROOT/core/UCA/release/lib/i686-pc-linux_dbg.GNU3_4_4
$ROOT/core/OpenSDF/SDF/SDF_SchemaCompiler/src/SDF_Schema.cc
cd $ROOT/core/OpenSDF
export INSTALL_ROOT=$ROOT/core/OpenSDF
export PROJECT_PATH=$ROOT/core/OpenSDF

cd $ROOT/core/Common
cd $ROOT/core/CASGCommon
export INSTALL_ROOT=$ROOT/core/CASGCommon
ln -s dotproject.project
cd $ROOT/core/UCA
export INSTALL_ROOT=$ROOT/core/UCA
ln -s dotproject.project
grep /home/cdot/c4

---------- Post added 03-05-13 at 02:12 PM ----------

Thanku shivaa
 
Old 03-05-2013, 04:15 AM   #11
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
No need to use any other variable. The $HOME in-build variable is enough to hold /home/cdot directory.

Else you can do following in your script:
Code:
VAR="/home/cdot/c4"
Then you can use this, as:
Code:
cat $VAR/foo.txt
OR
cd $VAR/bar
To make changes in your script, once invoke:
Code:
~$ gawk '{gsub(/\/home\/cdot\/c4/,"\$VAR",$0); print $0}' myscript.sh

Last edited by shivaa; 03-05-2013 at 04:19 AM. Reason: Code added
 
Old 03-06-2013, 12:58 AM   #12
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Can you please suggest me some link or book for studying an practicing the scripts..
Thanku
 
Old 03-06-2013, 01:08 AM   #13
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Best reference books are here.

Please Mark the thread as solved, if you think it has so (option is under Thread Tools on top menu).
 
Old 03-06-2013, 02:30 AM   #14
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
See also
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
 
Old 03-13-2013, 01:28 AM   #15
ankitarajdev
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
problem while replacing a directory with the variable

There are some scripts made in the path root/c4/build and in that scripts we have used the path /home/cdot/c4. So i want to replace /home/cdot path with some variable. Rightnow I am acccessing my scripts from root/c4. I want to write a script in root so dat in the scripts, home/cdot path gets replaced with that variable. How can I do that?

Thanku.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Unarchiver: Finally A Free Software Tool To Extract RARv3 Archives LXer Syndicated Linux News 3 05-21-2011 04:44 AM
[SOLVED] wrong permissions to extract archives even though logged in as root. jzbrown Linux - Newbie 7 10-09-2009 11:52 AM
shellscript to extract multiple archives quackyo Programming 13 04-27-2009 06:39 AM
Extract all archives in rar infonlinebr Linux - Newbie 5 05-30-2008 07:52 AM
How do I install B and Gzipped Archives Playtimes420 Linux - Desktop 3 08-13-2007 12:22 PM


All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration