10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying use sed to replace a string in a file with input string passed, but it is not replacing the string. instead it replace as $1. Please find below the code.
echo $1
sed -i.$now "s/http.*.myservice.*.war/$1/" tempfile.xml
I am running above code as below
myscript.sh ReplaceString... (4 Replies)
Discussion started by: sakthi.99it
4 Replies
2. Homework & Coursework Questions
Just started learning Unix and received my first assignment recently. We haven't learned many commands and honestly, I'm stumped. I'd like to receive assistance/guidance/hints.
1. The problem statement, all variables and given/known data:
How do I write a shell script that takes in a file or... (4 Replies)
Discussion started by: fozilla
4 Replies
3. Shell Programming and Scripting
I have a program that requires the user to enter input values while it is being run
for example in bash
...
...
..
echo "Enter your input"
read input
echo $input
...
...
...I need to schedule this program with crontab, hence a problem, cronjobs run in the background, any ideas on how to... (10 Replies)
Discussion started by: walforum
10 Replies
4. Shell Programming and Scripting
So, I am new to shell scripting and have a few problems.
I know how to read from standard input but I do not know how to really compare it to say, a character. I am trying to compare it to a character and anything exceeding just a character, the user will get an output message, but the program... (7 Replies)
Discussion started by: Bungkai
7 Replies
5. Shell Programming and Scripting
Hello,
I am new to scripting.
How do I read multiple lines from the command line?
I know read reads one line, but if I have to read multiple lines, how should I do?
Thanks,
Prasanna (4 Replies)
Discussion started by: prasanna1157
4 Replies
6. Solaris
Please give me any example for standard input in Solaris. (6 Replies)
Discussion started by: karman0931
6 Replies
7. Shell Programming and Scripting
Hi
I am trying to write a shell script which should take the file as standard input. As file(content and name both) will change for each run. It should read the file line by line. with each line I have to perform certain operation.
For example
I have i file foo, it looks like
/usr/doc/abc... (4 Replies)
Discussion started by: shashiprakash81
4 Replies
8. Shell Programming and Scripting
Dear...
I have a scrpit that contains multiple read command.... when I run the script I have to enter 3 variables so that I can get the output..
but, I dont want to put those 3 inputs manually every time... I want to make a shell that reads the 3 inputs from a file.
the script name is... (4 Replies)
Discussion started by: yahyaaa
4 Replies
9. Shell Programming and Scripting
Hi,
I am passing the file filename to a program and I have to use the "<" sign:
program < filename
Inside the program I would like to assign the string "filename" to a variable var.
I can't do that with "var=$(echo $1)" because of the "<" sign.
Removing the "<" sign would work for echo,... (13 Replies)
Discussion started by: calandrea
13 Replies
10. Shell Programming and Scripting
how can i redirect standard input? i dont remember :/, though could you redirec not from a command? i mean, to redirect always stdin and stout (1 Reply)
Discussion started by: Jariya
1 Replies