LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-16-2011, 11:57 PM   #1
BMan8577
Member
 
Registered: Apr 2011
Posts: 73

Rep: Reputation: 0
Question I need help with creating environment variable in the .bashrc file....


Ok, 1. I am trying to change the HISTSIZE environment variable to resolve to my process id. How do I change that variable successfully? 2. How do I create a CLICHE environment variable? 3. How do I redirect the output of the date command into a file in the home directory? Also how do you identify the process id and parent's process id?

Last edited by BMan8577; 04-17-2011 at 12:06 AM.
 
Old 04-17-2011, 12:28 AM   #2
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Hi,

1. In your ~/.bash_profile, add these :

export HISTSIZE=1000
export HISTFILESIZE=10000

HISTSIZE holds the number of events during a session.
HISTFILESIZE holds the number between sessions. This var determines the number of lines of history saved in history list file (default to ~/.bash_history).

Type source ~/.bash_profile at the prompt to make it effective wihout logout-login. Check with command env | grep HIST.

2. What dou you mean by CLICHE environment variable?

3. date > ~/today.txt


----
sibe
 
Old 04-17-2011, 12:43 AM   #3
BMan8577
Member
 
Registered: Apr 2011
Posts: 73

Original Poster
Rep: Reputation: 0
I have to create an environment variable CLICHE in which I am to resolve the message "that is how the cookie crumbles". So for the output would it be CLICHE="that is how the cookie crumbles" correct? I am a beginner at the Linux OS in my class which is the basic Redhat Computing Essentials and I am more of a kinesthetic learner...so if I get the right help I need I would be able to understand Linux a lot better...lol.
 
Old 04-17-2011, 12:44 AM   #4
BMan8577
Member
 
Registered: Apr 2011
Posts: 73

Original Poster
Rep: Reputation: 0
And I give you all the credit for helping me with my questions thanks. I really appreciate it.
 
Old 04-17-2011, 01:13 AM   #5
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Quote:
Originally Posted by BMan8577 View Post
So for the output would it be CLICHE="that is how the cookie crumbles" correct?
Correct.
To make it persistent, put your var in ~/.bash_profile; export var_name="value here".


----
sibe
 
Old 04-17-2011, 10:00 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Try bookmarking these links
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
  


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] Setting environment variable Lenny did not worked in .bashrc 2.6.26-2-xen-amd64 tkmsr Debian 2 04-28-2010 09:26 AM
Creating New Environment variable digambar_borse Linux - Newbie 1 11-25-2008 10:23 PM
.bashrc personal environment variable hua Linux - Software 1 04-11-2008 04:12 AM
how to add environment variable to .bashrc file hasan Linux - General 7 10-03-2003 05:43 PM
how to add environment variable to .bashrc file? hasan Red Hat 1 10-03-2003 02:37 PM


All times are GMT -5. The time now is 05:10 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