General :: Appending To PROMPT_COMMAND In .bashrc

Sep 29, 2010

I have the following as my $PROMPT_COMMAND in .bashrc:

Code:
PROMPT_COMMAND='
if [ $TERM = "screen" ]; then
MYPWD="${PWD/#$HOME/~}"
[ ${#MYPWD} -gt 20 ] && MYPWD=..${MYPWD:${#MYPWD}-18}
echo -n -e "33k$MYPWD33\"
fi
'

I am trying to append items to my PROMPT_COMMAND in another script/on command line. If I do the following:

[Code]....

I get no error. I've echoed the value of $PROMPT_COMMAND in both cases and their output is exactly the same.

View 4 Replies


ADVERTISEMENT

General :: Appending Acpi=off To Grub Two

Mar 12, 2010

I have a Toshiba Satellite L505D-GS6000 it had windows7 on it when I bought it new. Needless to say windows just ran too slow. The only Ubuntu distro that would boot up was Karmic 9.10. I had to append the phrase acpi=off to get the live ISO to boot I had to type acpi=off after the word splash. I saw it would boot so I installed it as the only OS on this computer.

Now when I boot up I am hitting the power button once and the back on again to get to the grub. I hit the E key use my arrows down to the word splash type acpi=off. Then hit CTRL X to boot up. How do I put this permanently into Grub2.

View 10 Replies View Related

General :: Appending Text To Profile In Ubuntu?

Mar 21, 2011

I want to append following text to my profile file from script:

JAVA_HOME="/usr/lib/jvm/java-6-sun"
CATALINA_HOME="/usr/share/tomcat6"
CATALINA_BASE="/var/lib/tomcat6"
ANT_HOME="/usr/share/ant"
export JAVA_HOME CATALINA_HOME CATALINA_BASE ANT_HOME

Kindly let me know how can I accomplish this?

View 2 Replies View Related

Fedora :: Add Path In .bashrc By Commenting Out Old Path And Adding New One - Command Source ~/bashrc

Jun 14, 2011

When I add some path in .bashrc by commenting out old path and adding new one like this:

#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY

After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.

View 10 Replies View Related

General :: Shell Script For Appending Data To A File?

Feb 8, 2011

this is how we append a file at command line its like

cat>>file.txt
adasds
^D

but how to write the code for appending a file in a shell script i tried but its not running

cho "the contents of the file before appending"
cat ab.txt
echo `cat >> ab.txt

[code]....

View 3 Replies View Related

Slackware :: Display The Full $PROMPT_COMMAND Environment Variable In The Konsole Title Bar?

Mar 18, 2011

IN 3.5.10 I am able to display the full $PROMPT_COMMAND environment variable in the Konsole title bar. Kind of handy and I did not need to display that information in the $PROMPT variable.

In 4.5.5 I am having trouble figuring out how to make that work correctly. The title bar displays only the directory name rather than the full path and user name.

This is my $PROMPT_COMMAND:

history -a;echo -ne "33]0;${USER}@`uname -n`: ${PWD}07"

All I see in the title bar is:

dirname: bash

I should see:

username@hostname: full path to present working directory

View 5 Replies View Related

General :: Appending File Extensions To Filenames In Bash Scripts?

May 18, 2010

Suppose I have a variable called filename which contains the name of a file but the name does not contain an extension.

View 4 Replies View Related

General :: Command For Appending A Text At The Start Of Every Line And Save It Another File?

Mar 10, 2011

I wish to append a text at the start of every line and save it to another file without changing the original file.know the command

For example:
Orignal.txt
a.txt

[code]...

View 5 Replies View Related

General :: Automatically Appending Date To Filenames Of Photos Imported Using Shotwell Or F-spot

Nov 26, 2010

Is there a way to automatically append date to the filenames of the photos imported using shotwell or f-spot?

View 9 Replies View Related

General :: How To Edit The .bashrc

Feb 27, 2011

I want something like

Code:

export ROS_PACKAGE_PATH=~/ros:$ROS_PACKAGE_PATH

to be done already for me when I open a new terminal. How do I edit the .bashrc so that this variable is always set already?

View 3 Replies View Related

General :: Echo Function In .bashrc?

Feb 25, 2010

I'd like a function in my .bashrc file that would allow me to pass text to it and echo the text to a specified file. I know it's simple as "echo 'text' >> file," but ideally, I would want to alias the function so I execute something like:

Code:
user~ $ write 'this is a test' with "write" being the function, and 'this is a test' being echoed to the file. I hope I explained that well enough.

View 3 Replies View Related

General :: .profile/.bashrc Not Being Read?

Apr 5, 2010

A cluster with a head node and compute nodes. An application with a couple of env variables (App_HOME, PATH) set in .profile (default shell sh). If I login to the head node/compute nodes on a terminal everything works fine. The correct env variables are set and the application works. However, when my application tries to do it, say ssh <compute node1> <application>, it appears the environment variables are not available. It only looks in the minimal /bin, /usr/bin type PATH. This tells that the .profile is not being read

View 2 Replies View Related

General :: Appending To The Current Line In A File Instead Of Creating A New Line?

Apr 1, 2011

I am combining data from a couple different input files and creating an output file in a specific format. I notice that if I use the >> operator, information gets appended to a new line in my output file. This is useful, but if I'd like to append onto the CURRENT line, is there an easy way to do this? I've been googling around and see lots of complicated answers, nothing that suggests to me an easy way to do this. For example, if my output file looks like this:

b1a:] cat test
hello my name is
b1a:]

and I'd simply like to append "Bob", how can I do it? If I use

b1a:] echo Bob >> test
b1a:] cat test
b1a:] hello my name is
Bob
b1a:]

So what I would prefer is some command that would create the result:

hello my name is Bob

View 14 Replies View Related

General :: Escape Commands In A Bashrc Alias?

Sep 17, 2010

I need to occasionally touch a file with the current timestamp as the filename. I would do so this way:

touch `date "+%Y-%m-%d_%H-%M"`.txt

However, I'd like to define an alias for this. When I try adding to the bashrc this:

alias td="touch `date "+%Y-%m-%d_%H-%M"`.txt"

the result is that the filename is the same during the entire session, since the `date ..` gets calculated just once during login...

How can I get the command to expand only when I call the alias? Or must I use a function for this?

View 1 Replies View Related

General :: Automate Sourcing .bashrc When Su - To Root

Oct 16, 2010

I need to source the my /home/me/.bashrc file every time I "su -" to root. Is there any way to automate this? I cannot edit any thing in the root's environment as it is shared by people.

View 7 Replies View Related

General :: Variable Expansion In .bashrc Not Working?

Feb 21, 2011

In my .bashrc file, I am attempting to set JAVA_PATH to a local path, using the HOME environment variable or '~' symbol as shown in the following examples.Using ${HOME}

export JAVA_PATH='${HOME}/Software/java/jdk1.6.0_24'

When I attempt to use ${JAVA_HOME} in a my ${PATH} javec is not found. To debug it, I tried a simple ls command:

ls ${JAVA_HOME}

and get the following error:

ls: ${HOME}/Software/java/jdk1.6.0_24/: No such file or directory

Using '~': Trying to use '~' symbol as follows:

export JAVA_PATH='~/Software/java/jdk1.6.0_24'

the ls command results in the same error, however javac is found.I prefer the '~' symbol anyway, but would like to understand why the ls command does not work for either, and why it seems as though ${HOME} is not being expanded.

View 2 Replies View Related

General :: Deleted .bashrc File Accidently

Apr 11, 2010

I accidently deleted my .bashrc file. I am a Debian user.Wat should i do??

View 7 Replies View Related

General :: Use Environment Variables In The .bashrc File?

Apr 16, 2011

I am trying to include my directory /usr/sbin in it's serch path for executable files using an environment variable. Would the input be: PATH="/usr/sbin"? And also upon start up, my shell should create the PRINTER environment variable which should resolve to the word sales...would that input be: PRINTER="sales"? If someone could help me with these two questions,

View 3 Replies View Related

General :: How To Create /.bashrc In My Home Directory

Nov 12, 2010

How to create /.bashrc in my home directory? do i make a folder naming it /.bashrc or i make its as a file?

View 7 Replies View Related

General :: Get Path Of Sourced Bashrc File?

Feb 11, 2011

I want to assign the path of a sourced sub.bashrc file to an environment variable. E.g. if I type (or execute) from a known relative location

$ source ../../someDir/sub.bashrc

the sub.bashrc should set a variable like

export MyOwnLocation=/home/user1/unknownlocation/someDir

The problem is I can't use $0 as reference because the script is only sourced not executed. I also don't want to hardcode the path because the location might change and there will be more copies. Is there an easy way to create this information from within the the sourced bashrc file? I use Gnu bash 2.05b on Suse Linux 9.

View 6 Replies View Related

General :: Joining Two Commands In The .bashrc File?

Apr 15, 2011

attending class in the Redhat Academy Website. I was wondering how can you join the two commands of cd/usr & ls successfully in the .bashrc file?

View 10 Replies View Related

General :: Script After Putting The File In Bashrc?

Oct 23, 2010

I have a problem with my script. The problem is the system keeps rebooting after I put the directory file in .bashrc. The intentional for putting the file in .bashrc is to run the script automatically after login as root, I don know why is this happen. It was working fine for the first time without putting the file in bashrc. I could break the loop after hitting the "ESC" key. would it be the script problems?

Here is my script
count=20
while [ $count -gt 0 ];do
sleep 1
echo Press ESC to break the operation
((count=count-1))

[Code]...

View 11 Replies View Related

General :: Set Path For Different Software In The Bashrc File?

Aug 24, 2010

I have installed a software and set the variables in the .bashrc file to avoid setting them everytime I would like to run te software. Now I have installed a new software and would like to do the same thing in the .bashrc file.How can I add the path to the new software directory without affecting the first software path.

View 2 Replies View Related

General :: Where To Write JAVA_HOME? In .bashrc Or In .bash_profile

Feb 9, 2010

Where to write JAVA_HOME? In .bashrc or in .bash_profile? What's the difference?

View 1 Replies View Related

General :: Function In Bashrc Is Not Recognized On Command Line?

Feb 28, 2010

I have added mkalias in my .bashrc file as I learnt here

[Code]...

View 1 Replies View Related

General :: Can't Change Permission For Bash.bashrc File?

May 28, 2010

I tried following the example from here (http:url]......)Open up publicity.html for reading and writing by anyone.

Before: -rw-r--r-- publicity.html
Command: chmod og=rw publicity.html
After: -rw-rw-rw- publicity.html

Here's my terminal session:

username@ubuntu:/etc$ -rw-r--r-- bash.bashrc
-rw-r--r--: command not found
username@ubuntu:/etc$ chmod og=rw bash.bashrc[code]....

View 2 Replies View Related

General :: Make A Save Command By Editing The .bashrc

Feb 19, 2011

I found this script [URL].. Basically this is a shortcut for cd-ing my file system..

I can type "save nm" where "nm" is any short name for the directory, like "blog" or "blg" Then whenever I want to go to nm I'll just use 'cd nm'

But it is not working out for me, I get this error every time I enter save:

bash: save: command not found
bash: parse_git_branch: command not found

So How can I make this command work?

View 1 Replies View Related

Ubuntu :: .Bashrc File - General Guide To Customizing It?

Mar 3, 2011

I want to play around my .bashrc file, but I can't seem to find a general guide to customizing it. I just want a guide that will show me examples and explain them in-depth.

Does anyone where to find one?

View 2 Replies View Related

General :: Erasing Default Root Bashrc In Fedora 13

Mar 6, 2011

I erasing default text in fedora 13 root bashrc and when I want to swich user ( with su command ) to root , icant,and i see bash-4.1????

View 1 Replies View Related

General :: Modify My PATH In Ubuntu Bashrc For A Software

Jan 25, 2011

I was installing a software in my Ubuntu 9.10 and after installation completed it prompted the following warning:

Warning: Your PATH does not point to your newly installed /home/pc/Reflex/software/bin/esorex.

To ensure execution of the newly installed software you should modify your PATH.

Note that "esorex" is the executable file and by typing its name in the Terminal the program starts.

What should I write in my "bashrc" as PATH to that program?

View 3 Replies View Related







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