In a shell script... How do I capture stdin to a variable without stripping any trailing newlines? Right now I have tried: var=`cat` var=`tee` var=$(tee) In all cases $var will not have the ...
I'm looking for something that behaves like Perl's chomp. I'm looking for a command that simply prints its input, minus the last character if it's a newline: $ printf "one\ntwo\n" | ...
I've been working on a bash script all day and have been testing on the machine I will be using it on. When I copy the script across from Notepad++ into a new file with nano editor inside SSH and ...
I'm trying to write a script that I can run from the context menu in Caja (a clone of Nautilus). Its purpose is to pass the files that are selected in the file manager to a given program (for example, ...
This is my script: #!/bin/sh # 5. Write a Shell Program to Find the Area & Circumference of a Circle echo "Enter the Radius" read radius arear=`echo 3.14 \* $radius \* $radius |bc` circu=`echo 2 ...
I have something odd. I creates some directories using a very simple script : ... create all directories ( running under a user that has the correct rights ) e.g : mkdir -p ...
When I try to run the following script in zsh, via the command /bin/zsh ~/.set_color_scheme.sh I get the following error: command not found: ^M The script has u+x permissions and it used to work on ...