General :: How To Go Back Or Forward A Word In Bash Environment

Mar 3, 2010

How can I move around the bash commandline efficiently?In the Windows prompt, one can go back or forward one word by pressing ctrl and <-/->.What's the equivalent in a bash environment?

View 1 Replies


ADVERTISEMENT

Programming :: Bash Shell Script Read File Word By Word?

Jan 21, 2011

I have a output file look like this:
{"test1" : "test2", "test3" : "test4"},

How can I read word by word in each line?This is not working code:

a=0
while read word
do a=$(($a+1));

[code]...

View 14 Replies View Related

Programming :: Bash Read Input Word For Word ?

May 4, 2010

I am pretty new to bash scripting...I am trying to write a script that will take an input and read it word for word and then DO something with it like echo. I have been able to find how to read word for word from a file but I don't know how to do it with input.

I was looking for something like

Code:

exit 0 The input would be A-Z a-z 0-9 and have a single space between each word.

View 2 Replies View Related

General :: Use Cd Command To Navigate Back And Forward (like Browser)?

Sep 6, 2011

Is it possible to use cd command to navigate back and forward (like browser)?. Something similar to cd - but it only swaps current and last location. I know I can push dir on stack, it would be great to use cd -> and cd <-, though.

View 3 Replies View Related

General :: Word Search In Files Using Bash?

Oct 9, 2010

I'm trying to use Bash to search some directories for a word in one of documents. I've tried:

Code:

$ grep -R Brzeninski /media/disk-1/Dual_Data/

but It never returned a prompt, and i'm not sure what grep means or does.

View 1 Replies View Related

General :: Bash: Replace All Occurrences Of A Word In The Last Command

Mar 9, 2011

Almost by mistake, I figured out you could do something like:

$ cp foo.data bar1.data
$ ^bar1^bar2

And that runs the same command with bar2.data instead of bar1.data. Now, how about if I have multiple occurrences of the target word? For example:

$ cp foo.data bar.data
$ ^data^index

It only replaces the first data extension. How do I get it to replace both?

View 1 Replies View Related

General :: Write A Bash Script That Will Read The Word From The Text File?

Jun 10, 2011

I have a text file that contains a single word and I want to write a bash script that will read the word from the text file... The following is my incorrect attempt, as it assigns the name of the textfile to the variable as opposed to the word stored within the textfile:(assume I have a text file value.txt that has its contents a single word, say wordone)

Code:
#!/bin/sh
for f in value.txt
do
echo $f
done

so the output of the above script is value.txt, however I want it to be wordone.to summarise: how do I assign the value of the word contained within a textfile to a variable?

View 1 Replies View Related

General :: Replacing Word Occurrence With An Increasing Number In A File Using Bash?

Aug 2, 2010

I have a file in the form below, and wish to replace each start line with an increasing number. So instead of:

Code:
start
content content
start
content content
start

[Code]....

After several searches and a bit of messing around, it's clear I'm missing something, so was wondering if anyone could offer any insight?

View 17 Replies View Related

General :: Why Can't Set Environment Value In My BASH Script

Jun 20, 2010

For example

Code:

I run "echo $PATH" after this script. The "/opt/bin" don't append to "PATH".

View 4 Replies View Related

General :: Concatenate Two Environment Variables In Bash?

Nov 9, 2010

How do I concatenate two environment variables in bash?

View 3 Replies View Related

General :: Which Environment Variables Not Inherited By Bash Shells

Jan 2, 2011

I am using Linux some years, but since I built a LFS, I feel noobish again. Now with the help of BLFS I am setting up my environment and somewhere I incidentally read, that not every variable is inherited by a child Bash shell. As for the $PS1 and $PS2 variables I know, that they are not inherited by non-interactive Bash shells (and there is no reason why they should in my opinion). Well, as for my first thread I hope the title gives enough information on what I want to know. But anyways: Which environment variables are not inherited by Bash shells?

View 1 Replies View Related

General :: Search & Replace Back Slashes To Forward Slashes In Windows

Feb 11, 2011

Lately I've been needing to delete new untracked files from my versioning system. Being in linux I use: hg status -un|xargs rm And it works nice, but when doing it in windows, hg status lists paths with backslash so that is where stuff goes wrong. So then I try: hg status -un|sed 's/\///g' ...but I get the error: sed: -e expression #1, char 8: unterminated `s' command

Then I try some ascii: `hg status -un|sed 's/o134/o57/g'`...that gets me: sed: -e expression #1, char 14: Trailing backslash And some scripting: hg status -un|sed 's/`echo `/`echo /`/g' ...that gets me: sed: -e expression #1, char 19: unknown option to `s'

I try all the last with any other characters and I get the expected output... so I'm completely lost. I have cygwin, of course, and I want to avoid using a file (that is what I've been doing).

View 2 Replies View Related

General :: Search Word And Delete Only The Word And The Line Using Sed Command?

Jun 28, 2011

Want to search for ~ and delete it as well as to append the entire line to the above line. For Ex:

1111xxxx date Sandy area is ~around this area.3222xxx date There seems to ~left side of map, the colours are accurate (showing green areas)Even if I ~zoom in, the green parks, xxx3258 date The dammed up
~away, the "other" body of water varies ~blackNatural gas leaching.

IT MUST LOOK LIKE:

1111xxxx date Sandy area is around this area. 3222xxx date There seems to left side of map, the colours are accurate (showing green areas)Even if I zoom in, the green parks, xxx3258 date The dammed up away, the "other" body of water varies blackNatural gas leaching.

View 4 Replies View Related

General :: Sed Append Word At End Of Line If Word Is Missing

Feb 19, 2010

I have to modify formsweb.cfg file in Oracle IAS.

Problem description

In formsweb.cfg file are two lines with labels archive_jini= and archive= at the beginning of line. After equal sign (=) is row of filenames of java archives delimited by coma(,). When I insert a new jar file in java directory, I have to append the very same name of jar file to both lines if that name is not yet present.

Example snippet from formsweb.cfg

View 2 Replies View Related

Ubuntu :: Back - Up - Forward Navigation Not Working Properly

Aug 17, 2010

I installed Ubuntu 10.04 on my systems. In the file browser or any internet browser, if I click on back, forward or up, nothing happens. I stays on the current page/location. Even if goes back, sometimes, it again comes back automatically to current page/location. I can navigate using keyboard but not with mouse.

System Configuration:
Processor: Core 2 Quad 2.5 GHz
RAM: 2 GB
Motherboard: Intel Desktop Board DG41RQ.

View 2 Replies View Related

Ubuntu :: Back And Forward Mouse Button In Opera

Jul 1, 2010

why these buttons would not work in opera but work in nautilus and firefox? I've tried to change the mouse settings in opera and nothing works. thoughts?

View 1 Replies View Related

Software :: Back And Forward Icons Missing In Firefox?

Jan 26, 2011

I'm running Sabayon Linux, and recently when through a major upgrade where a lot of packages were upgraded.

After the upgrade, when launching firefox, the back and forward icons are missing. The buttons are actually there, as I can still select an empty grey rectangle. I also checked and it's happening for all users on the system.

I was using the persona's theme, but I stopped using that (for performance reasons). I just disabled it, I haven't actually removed it.

I tried re-installing gnome-icon-theme package from a suggestion on another linuxquestions.org thread, but that didn't help.

It's not a big deal as I can still use the buttons, but curious if anyone has any insight into what I can do to get the icons back.

View 2 Replies View Related

General :: Bash - Get ' Quote ` Back-tic Through The Shell Into Sed?

Aug 3, 2011

In linux how do I to get the ascii decimal/hex/oct code from a char or a ascii char from a decimal/hex/oct code. I see from the gnu sed user manual that I can use the d# o# x# to specify a character but I am not sure how to use that. If some one has a better way to get the the ` and ' chars through I want to sed with the backtick '`' character and ''' single quote character.

sed '/`/p'

these don't work

sed '/'/p'
sed '/`/p'

View 3 Replies View Related

Ubuntu Multimedia :: Make VLC Jump Forward Or Back Using The Mouse Wheel?

Jan 15, 2010

How do i make VLC jump forward or back using the mouse wheel regardless of where i have the mouse cursor in the window? I went to preferences and changed the hotkey to 'short forward jump' to mouse wheel forward, but nothing seems to happen when i press the forward button.

View 2 Replies View Related

General :: Execute Bash File - Always Back To Home Dir?

Apr 11, 2010

In my bash file I have asked to navigate to some subdir, unzip a file and stay there but when I type pwd I can see i'm always back to home dir.Any way to get shell stick to subdir?

View 4 Replies View Related

OpenSUSE Hardware :: Get The Forward And Back Buttons On Logitech Surface Mouse Working In 11.2

Dec 31, 2009

I am trying to get the forward and back buttons on my Logitech Surface mouse working in openSUSE 11.2 running as a guest in VMware Workstation 7 on a Win7 x64 Pro host. I have read many places about editing the xorg.conf file and have done so successfully under Ubuntu in the past. I have successfully installed VMware Tools and everything is working as expected except the side buttons on the mouse. I have no current xorg.conf file

View 5 Replies View Related

Programming :: Bash Script - Grepped A Log File To Obtain Every Line That Contains A Word

Dec 8, 2010

I have grepped a log file to obtain every line that contains a word (let's call it 'blah'). I now want to only display a list of entries within that search result that feature the word 'host' anywhere in the line, and I also want to display the single word *after* 'host' (up until the next space). So, the end result will look like this:

[Code]....

View 8 Replies View Related

Software :: Fvwm Resize Throws Off Xterm (bash) Word Wrapping

Aug 27, 2010

when I resize an xterm in fvwm, bash word wrapping is messed up. I don't know if it's from running a program that uses curses or not.

View 1 Replies View Related

Ubuntu Multimedia :: Movie Player - Move The Progress Bar Or Scroll Back Or Forward It Will Just Instantly Close

Mar 2, 2010

I have recently had problems a with Movie player. It seems to having trouble playing DVD's and video files. it has a tendency to stop/freeze and sometimes if I try move the progress bar or scroll back or forward it wil just instantly close the Movie Player. I'm wondering is there a way to check it for bugs or is there a more reliable/better quality player that I could get instead.

View 9 Replies View Related

Ubuntu :: Put An Environment Variable Back To Its Default?

Mar 2, 2010

I am happy to say that after almost a week of wandering around the INTERNET and posting desperate questions to our Ubuntu forums on how to set paths etc., I have finally begun to understand just how environment variables and path setting works. I must say, it wasn't all reading this or that, but rather making changes to my paths that helped me to understand. Anyway, if anyone who does not understand environment variables is reading this, then I recommend reading this

HTML Code:
http://java.sun.com/docs/books/tutorial/essential/environment/paths.html
and this
HTML Code:
http://www.belugalake.com/java/pathsetting.html

OK- I have 1 last question for my fellow linux users. Lets say I opened up $HOME /.profile and did some editing, and later decided to undo all of my changes but I forgot exactly what changes I made so now I want to set the default in there. How would I accomplish this? How do I set the defaults for any ~/.bashrc or ~/.cshrc type of files that I change.

View 1 Replies View Related

Ubuntu :: Back To Desktop Environment From Init 1?

Oct 24, 2010

I have been using Debian desktop environment for years. There, I can sudo init 1; do maintenance; exit to desktop environment again. But when I `resume' from Ubuntu-10.10's maintenance mode, I can just Ctrl-Alt-F1 to login and there seems not an interesting process running.

View 4 Replies View Related

Ubuntu Installation :: Cannot Get Back To The Desktop Environment?

Feb 13, 2011

I just set up a new PC with a copy of 10.04.2 from the disk that came with "The official Umbuntu book" This morning it prompted me to run updates so I did; now I cannot get back to the desktop invironment. Tried F7, but it stops at "checking battery state."

View 1 Replies View Related

Ubuntu :: Gnome 3 - Get Back Desktop Environment?

Jul 29, 2011

i use ubuntu 11.04. why my taskbar lost. border windows also lost. why? how to get back my desktop environment?

View 1 Replies View Related

Programming :: Read Two Files Word By Word At A Time Using Any Loop By Shell Script?

Mar 4, 2010

Well, I am facing one issue:How can i read two files word by word at a time using any loop as i need word by word comparision in shell script?Please let me know pseudo code.

View 14 Replies View Related

General :: Next Word Of A Particular Word ?

Feb 9, 2011

In linux is there a way to find the next word of a particular word of a file. grep displays entire line of the particular word. But i want only the exact next word of that particular word.is there any command for that.

View 13 Replies View Related







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