PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

Some bash questions


Your Ad Here

Your Ad Here

composlinuxmisc

Options to programs usually start with "-", so grep is trying to interpret -2718 as an option to grep rather than a pattern. Most Unix command line utilities use "--" to signal "end of options" so using 'grep -- -2718' will force grep to treat "-2718" as the "pattern".

snip

You probably don't want to "pipe" it per se. You want to use the output of the readlink command as an argument to cd, which is done with the backtick operator ` in Bash. So:

cd `readlinkproc-12345-cwd`

will do what you're looking for (I think).

(To "pipe" that to cd would mean to send readlink's standard output to cd's standard input. But cd doesn't read from stdin. It's a minor difference in terminology when I said earlier that you don't want to pipe it per se.)

Use 'find' to locate the files and then use 'sed' to change them. I wrote a brief note about 'sed' about an hour ago in this very newsgroup. That should be enough to get you started. A (rough, untested) example:

findhome-me-work-name input.txt -exec sed -ie 's-^Random seed = 2718$-Random seed = 314159-'{};

Note that the pattern I've shown will only match when the line reads exactly as you stated, to avoid corrupting other data. If you just replace "2718" with "314159" you might end up changing other lines that happen to contain the substring 2718. (E.g., "Other data = abc 2718 def" could get changed if you're not careful with your pattern.)

connecting to display & tcp capture
Pre-PS - I now have two questions) I have a Fedora Core 4 system that I'm trying to understand. For someone who is inexperienced at lots and...

The "-{};" bit gets expanded to the filename that 'find' prints out, and is pbutted to 'sed'.



Your Ad Here

List | Previous | Next

connecting to display & tcp capture

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

Some bash questions