LinuxQuestions.org
Help answer threads with 0 replies.
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 11-22-2010, 12:21 PM   #1
ramzaher
LQ Newbie
 
Registered: Nov 2010
Posts: 25

Rep: Reputation: 0
saving a content of files(contain location to a directories) into variable


#the file temp contain a path to a directory int the first line
a= `head -1 temp`
bash: /home/ram/linuxTraining/scripting/testDir/test1Dir/test2Dir: is a directory
 
Old 11-22-2010, 12:53 PM   #2
barriehie
Member
 
Registered: Nov 2010
Distribution: Debian Lenny
Posts: 136
Blog Entries: 1

Rep: Reputation: 23
Quote:
Originally Posted by ramzaher View Post
#the file temp contain a path to a directory int the first line
a= `head -1 temp`
bash: /home/ram/linuxTraining/scripting/testDir/test1Dir/test2Dir: is a directory
Code:
a=$(head -1 temp)
 
1 members found this post helpful.
Old 11-22-2010, 01:07 PM   #3
reynaldohortensi
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 1
Hi,
I think you put a space between = and `
Erase it.
 
1 members found this post helpful.
Old 11-22-2010, 02:02 PM   #4
ramzaher
LQ Newbie
 
Registered: Nov 2010
Posts: 25

Original Poster
Rep: Reputation: 0
thanks the both solutions work
 
Old 11-22-2010, 09:11 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,505

Rep: Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890
Please mark as SOLVED if you have a solution.
 
  


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
[SOLVED] cannot compare two directories, and print files that have same name and content apanimesh061 Fedora 3 09-17-2010 10:17 AM
[SOLVED] Move some of the files from multiple directories to one location alex_chartier Linux - Newbie 4 06-21-2010 03:14 PM
How to read the content of the memory location in S3C2440 grsandeep85 Linux - Embedded & Single-board computer 0 02-02-2010 11:27 PM
Saving windows position/content galapogos Mandriva 10 02-26-2009 09:41 PM
Find variable name by variable content using a subshell UltramaticOrange Programming 3 11-17-2008 03:51 PM


All times are GMT -5. The time now is 08:02 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration