I need a script that inputs a file and echos its contents with linebreaks removed - "word wrapped" so to speak.
I've tried:
"#!/bin/bash
find $HOME '$1' | while read line; do echo "${line}"; done"
but it just returns nothing.
while learning to write bash scripts, i decided to write some script that, given an integer as input, will tell you the square root of that integer (provided the integer in question is a perfect square). i have already done on using primarily if statements and a while loop. i decided that using a case statement would be a lot simpler and i would be able to make the script more functional.
hello everyone
I'm writing a bash script and I have to parse a line that looks as follows:
Code:
a/ b:4 word=egg things.?/things2//
no matter what other words or characters exist in the line,I only want to keep the word(or number) that comes after the =
in this case the word is "egg".
Is there a way doing this by using sed?
I create a bash script with using case syntax. My bash script option must be "./script user hello". Below is the content of the script.
Quote:
user=`echo "$1" | sed "s/$/@foo.com/"`
case $1 in
*)
echo "From: $user
TEST1" > /var/log/test1
This question is a sequel of sorts to my earlier question. The users on this site kindly helped me determine how to write a bash for loop that iterates over string values. For example, suppose that a loop control variable fname iterates over the strings "a.txt" "b.txt" "c.txt". I would like to echo "yes!" when fname has the value "a.txt" or "c.txt", and echo "no!" otherwise.
Hello Everyone,
Im a linux newbie and Im trying to create a very basic script that will echo a question like "What is your name?" but i would like for the question not to echo the whole sentence at once but word by word or even character by character, in other words to give the illusion that the computer is actually typing the question.I hope this makes sense.
Greetings!
I have a question about conditions in Bash scripts. I would like to know the difference between the use of parentheses and square brackets.
I had a command which would work through a text file, count all the occurrences of the words and print it out like this:
remy@box $˜ magic-command-i-forgot | with grep | and awk | sort ./textfile.txt
66: the
54: and
32: I
16: unix
12: bash
5: internet
3: sh
1: GNU/Linux
So it does not search line-by-line, but word by word, and it does it for all the words, not just for 1 word.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1.