Skip to content

Tag: shell

basics steps in converting xml file to html file

I would like convert a xml file to a html file. Where i can find a step by step tutorial (for linux) to do this in shell script, or which are the steps to follow. Sorry for the very basic question, but i am an absolute begginer on this. thanx Answer The basic tools to do this is XSLT. XSLT

basename with spaces in a bash script?

I’m working on a bash script to create a new folder in /tmp/ using the name of a file, and then copy the file inside that folder. Behavior: When I type in mymove “/home/me/downloads/my new file.zip” it shows this: I have lots of quotes around everything, so I don’t understand why this …

Bash/sh ‘if else’ statement

I want to understand the if else statement in sh scripting. So I wrote the below to find out whether JAVA_HOME is set in the environment or not. I wrote the below script This my output to env: But I get the below output: Answer You’re running into a stupid limitation of the way sh expands arguments. Lin…

linux shell title case

I am wrinting a shell script and have a variable like this: something-that-is-hyphenated. I need to use it in various points in the script as: something-that-is-hyphenated, somethingthatishyphenated, SomethingThatIsHyphenated I have managed to change it to somethingthatishyphenated by stripping out – us…

finding unique values in a data file

I can do this in python but I was wondering if I could do this in Linux I have a file like this I want to find all the different types of values in the 3rd column by a particular username lets say name 1. grep name1 filename gives me all the lines, but there must be some way to

Echo to both stdout and stderr

I have a probably pretty easy beginner question: How do I echo from a shell script into both stdout and stderr? I know that I can echo to stderr echo “foo” 1>&2 but I need the output in both. I tried some Googling but nothing worked. Answer This should do it