10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello everybody,
I would like modify some strings using sed or another command line with the content file.
For example:
- {fqdn: "server-01" , ip: "server-01"}
- {fqdn: "server-02" , ip: "server-02"}
- {fqdn: "server-03" , ip: "server-03"}
- {fqdn: "server-04" , ip: "server-04"}
My... (4 Replies)
Discussion started by: dco
4 Replies
2. UNIX for Beginners Questions & Answers
I want get from user and pass these parameters to bash script. script should copy files in user home directory.
FYI: each file might be exist or not, might be one of them exist or four of them.
Here is my script, it always copy file1 and seems only one of them execute!
#!/bin/bash
for... (6 Replies)
Discussion started by: indeed_1
6 Replies
3. Shell Programming and Scripting
I need to be able to use a sed command as a variable in a bash script. I have the sed command that almost works the way I want it. the command is
sed -n '/inet/,/}/p' config.boot
This gets me this result:
inet 192.168.1.245
}
I need to get the IP address into a variable so I... (9 Replies)
Discussion started by: edlentz
9 Replies
4. Shell Programming and Scripting
I want to run commands inside a bash script.
An example is
I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable
sed.sh regexp
sed.sh "-i \"s/<p>//g\""
then call
sed "$regexp" $fl (3 Replies)
Discussion started by: Kangol
3 Replies
5. Shell Programming and Scripting
I wrote a code to find codons in a DNA string. The only problem I have is how do I make the code only work for a file with DNA. This means the file only has the characters a,c,g,t and no white space characters. (3 Replies)
Discussion started by: germany1517
3 Replies
6. Shell Programming and Scripting
In the below I can not seem to add a line that will add Not low if the statement in bold is not true or meet. I guess when the first if statement is true/meet then print low, otherwise print Not low in $(NF + 1). I am not sure how to correctly add this. Thank you :).
if(low <= $2 && $2 <=... (5 Replies)
Discussion started by: cmccabe
5 Replies
7. Shell Programming and Scripting
Hello.
I am using :
sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \
#'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \
#'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE"
Is there a better way to define "MY_TAB7","MY_TAB11" in other way than :
MY_TAB1=$'\t'
MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Discussion started by: jcdole
2 Replies
8. Programming
Hi, I have meaning to include an if condition statement in my code to check the directory for existing output files and if its existing i want the program to delete it before doing the succeeding command. i just dont know the correct syntax for it. thanks much guys, this forum has indeed been very... (4 Replies)
Discussion started by: ida1215
4 Replies
9. Shell Programming and Scripting
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies
10. Shell Programming and Scripting
How can I use a variable that has the conditions for the if statement stored in it?
my test script
condition=" || || "
if "$condition"
then echo "true"
else echo "false"
fi
output
$ ./test2.sh
./test2.sh: line 3: || || : command not found
false (2 Replies)
Discussion started by: curlee2002
2 Replies