Another one:
user@device:~ touch hi\ whats\ up
user@device:~ ls
hi whats up
user@device:~ touch hi\ whats\ up
user@device:~ ls
hi whats up
thank you very much sir.dilberts_left_nut wrote:For the sed part:Agvaniot wrote:im trying to take a dotted filiename "a.dotted.filename" and replace the "." with space
for example : "a dotted filename"
ive tried to come up with bunch of codes:Code: Select all
dottedfilename=$1 ${dottedfilename##*.*/' '/} | clipit
Code: Select all
sed -e 's/./ /g'` a.dotted.filename
A . is a wildcard that matches any character, you need to escape it with a \ to match an actual .
Code: Select all
sed -i 's/\./ /g' filewithdottedstring
When used as a 'file' argument and interpreted by the shell, yes.Agvaniot wrote:i have 2 more questions in order to understand it fully
1. is "." not considered the current directory rather than a wildcard of any character?
The quoted string is the regex expression that is passed to sed, it is not interpreted by the shell (because it is quoted to prevent that). You can also, in appropriate circumstances, use nested single and double quotes, but that way madness lies ...2. if we sad that "." is wildcard that match any character still its within the single quoted string within sed doesnt supposed to surpress its special meaning?
thanks again sir
AdrianTM wrote:There's no hacker in my grandma...
Well, let's be honest, if the OP is trying to get help with an issue of dubious origin and is called out on it, he will of course protest his innocence. We can't know for certain either way. One can only go on the most likely scenario given experience of a] Linux use and b] internet users. I personally remain skeptical.ruffwoof wrote: It was clarified that the question wasn't homework yet you continue to proclaim that to be a lie.
I can't speak for other forum users, but in my own case, I come to learn from those with more experience, more knowledge, more applicable expertise than myself. I want to learn from people who definitely do know and have experience of the issues in hand, not those who nearly know and who provide makeshift responses to tide me over. Likewise, a student needs to learn from a master - not someone with a passable, meagerly applicable level of experience which wastes their time and risks development of bad habits.ruffwoof wrote:A assumption that visitors come here purely for accurate answers and that no one should respond to threads without 100% certainty of accuracy is simply wrong. It's a Debian Users forum within which participants can commonly share and learn across all ability/skill levels.
Debian is different from other distros in that working knowledge of Debian requires understanding of its ethic. The forums encourage people to do their own work and learning wherever possible so that they can a] learn how to research in computing and b] be better long-term members of the community as a result. The forums are not here for "how do I get Z to work from scratch" but "I want Z to work, I read about it and tried X and Y to get it, what am I missing that didn't make Z happen?". When I first started posting here I was told a couple of times [or more] to RTFM. It was not what I wanted to hear, but it was very good advice because it made me more self-sufficient.ruffwoof wrote:Otherwise a board comprised of 'go off and do a internet search' replies could be condensed to a single front end web page.
Well, there is such as thing as a stupid question, unlike what some forums would have you believe. You talk about fear like it's always a bad thing. Fear is often there as a protection mechanism. I can't believe that someone with excellent knowledge of a topic would be 'scared' of giving an answer, and I can't believe that someone who has done thorough research on a topic would be scared to ask a question. Asking lazy or idiotic questions is no substitute for doing one's own research.ruffwoof wrote:Fear of asking the wrong question or potentially giving a wrong answer suppresses development of knowledge.
Huh, would use Python to automate the task.pylkko wrote:[...]That will modify a file. However, in most computer science classes they want an answer that is generic, so that you could use it to change 1000 files all in different folders or something to that extent. You will need a small perl script to do it efficiently, and that is what the code in the OP is trying to do, only struggling with the escaping special chars.
I'm not familiar with Perl, apparently it would be simpler than using Python.pylkko wrote:Ok, how exactly would you do that? Mind you that in perl solutions like this are one liners. In python you would need the OS module then crawl the structure somehow?