LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

Pay attention to ";" versus "&&" in bash aliases

Posted 09-27-2017 at 04:54 PM by the dsc (linux-related notes)
Updated 09-27-2017 at 04:57 PM by the dsc

Or maybe avoid it altogether, it's probably some sort of well known linux/unix rule that someone wrote a long time ago.

It's possibly something that seldom ever is a problem to anyone, but it was for me.

I had this as an alias for "mv"

Code:
echo "use mv -i to avoid overwriting files with the same name; this is an alias to mv -i" ; mv -i
Then at some point I was doing an one liner that would scan symlinks' "realpaths"...
Member
Posted in Uncategorized
Views 88 Comments 0 the dsc is offline
Old

The "sed" command doesn't need quotes

Posted 09-15-2017 at 03:20 PM by the dsc (linux-related notes)
Updated 09-15-2017 at 03:38 PM by the dsc

You may have some trouble when trying to make sed replacements along the lines of:

sed 's|$originalpath|$otherpath/$filename|'

If the variables contain things like the "-" character, or some other special characters, some of the sed commands may be terminated before they should, in error, as it's taking part of the variable as sed commands, rather than parameters. Something like that. Then the variables would ideally be quoted, but with the outermost quotes, it's...
Member
Posted in Uncategorized
Views 171 Comments 0 the dsc is offline

  



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

Main Menu
Advertisement
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