Skip to content

Tag: variables

Using variables as the input to command

I’ve scoured various message boards to understand why I can’t use a variable as input to a command in certain scenarios. Is it a STDIN issue/limitation? Why does using echo and here strings fix the problem? For example, As you can see I get the error… ‘File name too long’ Now, I …

While loop not equal command not found

I am trying to perform a simple while loop comparing a variable to a string. It fails to load with the error on this line. Error states [: missing `]’ and : command not found. My while loop looks like; Answer There are a couple of errors: See that variable declaration do need to be like var=value. Other…

How to base64 encode image in linux bash / shell

I’m trying to base64 encode an image in a shell script and put it into variable: I’ve also tried something like this: but still with no success. I want to do something like this: I found this http://www.zzzxo.com/q/answers-bash-base64-encode-script-not-encoding-right-12290484.html but still have h…

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…