43,029 reputation
653118
bio website
location Living in Marseille, France
age 34
visits member for 2 years, 3 months
seen 6 hours ago

Elected moderator on Unix & Linux. Feel free to @ping me in chat if there's anything I can help you with.

I've been using Linux since the late '90s and have gone through a variety of distributions. At one time or another, I've been a user of Mandrake, SuSe, openSuSe, Fedora, RedHat, Ubuntu, Mint, Arch and for the past few years Linux Mint Debian Edition (which is basically Debian testing but more green).

My Linux expertise, if I can grace it with such a lofty title, is mostly on manipulating text and regular expressions since that represents a large chunk of my daily work.

profile for terdon on Stack Exchange, a network of free, community-driven Q&A sites


7h
awarded  Nice Answer
15h
comment Using s command to subsitute variables
Hi and welcome to the site. 1) There is no such thing as a UNIX s command; you probably mean Perl's s/// operator. 2) You need to show us your input and your desired output. 3) You need to explain exactly how your script is failing in order for us to be able to help. 4) You need to explain how the script is executed, with what parameters. 5) You need to show all of the relevant lines. What is the next_seq() function? Where is $seq defined? Please edit your question to address these issues.
15h
revised Using s command to subsitute variables
edited tags
18h
comment How to test for unknown commands in shell script?
That will still fail for commands that 1) are called by name and not path, 2) whose path has less than 2 / 3) that are called by relative paths (e.g. ~/bin/foo), 4) For all shell builtin commands. Also, it does not test things like $(command) etc. I don't think it is possible to do this simply.
19h
comment How to test for unknown commands in shell script?
@Minix his point is that "commands" can come from wherever. They can be stored in variables, they can be functions sourced from external files. They can be evaluated from other commands. How can you tell a script what is and what isn't a command? Also, essentially every line of a shell script is a command.
19h
comment Add 10 to a value in large xml file
Please edit your question and explain what features of your example we can depend on. Will there always be the same number of fields (words) on each line? Will you always want to modify only the last number of each line?
19h
comment Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
Let us continue this discussion in chat.
19h
comment Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
@JohnyTex there should be a Help menu in the file manager itself. Next to File, Edit, View etc.
21h
comment Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
@JohnyTex no, not at all. First, are you sure it's nautilus? It is actually probably nemo. Either way, please edit your question and include the specific name and version. You should be able to find them in Help -> About. I have the "open in terminal" option on nautilus, caja and nemo.
21h
comment Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
@JohnyTex what version are you running and are you sure it's caja and not another file manager? Check Help->About.
23h
answered Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
23h
comment Cinnamon: How to get path in text on GUI window, and how to open terminal at current GUI-window location?
In Cinnamon using what program? You mean in the default file manager, caja?
23h
answered in Bash, how to not include extra arguments in an alias?
1d
comment extracting a subset of lines from a large text file
@mikeserv I rolled back your edit because 1) I wanted to keep things simple and readable 2) your edit didn't work (you were matching 9 fields and then MEF2). It's the awk I'm pointing the OP towards. The more cumbersome solutions are just to illustrate.
1d
revised extracting a subset of lines from a large text file
rolled back to a previous revision
1d
comment Command line tool to “cat” pairwise expansion of all rows in a file
@Jidder no, I was redirecting the output. I always do when testing since printing to screen is so slow. I tested on an i7 quad-core laptop with 8G RAM.
1d
awarded  Good Question
1d
comment find and sed (find and replace) causes illegal byte sequence on Mac OS X
OK, then do not run that command. The sed is being run on the files themselves and the -i means "edit files in place" which means that it will be run on the actual files and not on the file names printed by find. I'm not sure what that did to your movie files but it very likely changed the data of any that matched .. Please edit your question and explain what you are actually trying to do.
1d
comment find and sed (find and replace) causes illegal byte sequence on Mac OS X
Are you sure that's what you want to do? That will remove . from the contents of the file. If successful it will damage your videos. Are you trying to rename them?
1d
revised find and sed (find and replace) causes illegal byte sequence on Mac OS X
Edited to avoid horizontal scrolling