LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-25-2013, 11:11 PM   #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-25-2013, 11:34 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 12:18 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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 12:20 AM.
 
Old 03-04-2013, 11:41 PM   #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-04-2013, 11:55 PM   #5
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
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, 12: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, 12:22 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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 12:26 AM. Reason: Typo
 
Old 03-05-2013, 12:26 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Probably best if you show us the script and be clear on what you want to see before and after.
 
Old 03-05-2013, 12: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, 02: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, 03:15 AM   #11
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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 03:19 AM. Reason: Code added
 
Old 03-05-2013, 11:58 PM   #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, 12:08 AM   #13
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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, 01:30 AM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See also
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
 
Old 03-13-2013, 12: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



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 03:44 AM
[SOLVED] wrong permissions to extract archives even though logged in as root. jzbrown Linux - Newbie 7 10-09-2009 10:52 AM
shellscript to extract multiple archives quackyo Programming 13 04-27-2009 05:39 AM
Extract all archives in rar infonlinebr Linux - Newbie 5 05-30-2008 06:52 AM
How do I install B and Gzipped Archives Playtimes420 Linux - Desktop 3 08-13-2007 11:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:35 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
Open Source Consulting | Domain Registration