Search Results

Search: Posts Made By: Dark2Bright
3,511
Posted By Dark2Bright
sed command works on Fedora/Ubuntu, but doesn't work in Mac
Hi, I have a question.
I define a function using sed command:

replace()
{
searchterm=$1
replaceterm=$2
sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp'
mv...
2,779
Posted By Dark2Bright
sed command works on Fedora/Ubuntu, but doesn't work in Mac
Hi, I have a question.
I define a function using sed command:
replace()
{
searchterm=$1
replaceterm=$2
sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp'
mv...
2,116
Posted By Dark2Bright
I understand. Thanks again.
I understand. Thanks again.
2,116
Posted By Dark2Bright
Yes, it worked for me. Don't know how to thank...
Yes, it worked for me. Don't know how to thank you enough.
I didn't know that [] is also a command, i thought that it just like "if (condition)" in C.
Just one last question, if [ is a command,...
2,116
Posted By Dark2Bright
Thank you very much for your replies. What I...
Thank you very much for your replies.
What I want to do is: I will run a program and write the result of its execution to the file "result.txt". Then I grep in the output file, if it contains the...
2,116
Posted By Dark2Bright
Sorry, but what is $?. I simplified the code,...
Sorry, but what is $?.
I simplified the code, actually I need to use the function verify at many condition, I cannot do anything with the if statement inside the function.
2,116
Posted By Dark2Bright
Code tags
I'm sorry. I tried to indent, but it seems that the space is automatically deleted. I will tried with your advice.
Thanks a lot.

---------- Post updated at 11:11 PM ---------- Previous update was...
2,116
Posted By Dark2Bright
A question about if statement
Hi everybody,

I'm sorry If I ask a silly question. I have a simple code like this
I have the following error:
Can anyone explain for me why I have this error, and how can I correct it?
Thanks...
15,490
Posted By Dark2Bright
Yes, my problem still remains. I will try with...
Yes, my problem still remains. I will try with your instruction. Thanks a lot.
15,188
Posted By Dark2Bright
Thanks a lot :)
Thanks a lot :)
15,188
Posted By Dark2Bright
The same error as mine. This will create the...
The same error as mine.
This will create the folder with name "aa". I want to create folder a30, a40,...
15,188
Posted By Dark2Bright
Help me with mkdir command
Hi, please help me with this small script

#!/bin/sh

curdir=`pwd`
n20=$curdir'/n20/'
msat=$curdir'/n20/msat/'

if [ ! -d $n20 ]
then
mkdir $n20
fi

if [ ! -d $msat ]
then
...
1,107
Posted By Dark2Bright
Thanks for your reply. Actually, at the beginning...
Thanks for your reply. Actually, at the beginning I wrote it exactly as above, but after I had encountered the error, I added "", but I still have the same error.


---------- Post updated at...
1,107
Posted By Dark2Bright
Please help me with a simple problem
Hi, I have a very simple script like below:
for n in 10 20 30
do
for a in 30 40 50 60 70 80
do
for r in 2 3 4 5 6 7
do
m=$((r*a))
count=1
...
15,490
Posted By Dark2Bright
I am sorry, I deleted some parts of the script to...
I am sorry, I deleted some parts of the script to make it simple. I want to display data in the range of [0.001..1000] for both x and y.
I want to write a function like this : f(x) = (x == 0) ?...
15,490
Posted By Dark2Bright
Using variables in gnuplot within a shell script
Hi everybody, please help me with this problem
Suppose I have a script like this to run commands of gnuplot.
#!/bin/sh
lib=$1
old="output/old/$lib.dat"
new="output/new/$lib.dat"

gnuplot <<...
2,464
Posted By Dark2Bright
Hi, another question. Is there any posibility...
Hi, another question.
Is there any posibility that this error only happens in some versions of the operation system?
I received that script from a friend of mine, and he said that there were no...
2,464
Posted By Dark2Bright
You save me! Many thanks :)
You save me! Many thanks :)
2,464
Posted By Dark2Bright
Problem with read line
Hi everybody, I am new to shell script. Please help me with this problem.
I have a file test.txt with the content like this:

I have a shell script test.sh like this
#!/bin/sh

while read line...
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 12:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy