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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OSF1
ntp.drift
ntp.drift(4) Kernel Interfaces Manual ntp.drift(4)NAME
ntp.drift - Network Time Protocol (NTP) drift file
DESCRIPTION
When the NTP daemon (xntpd) is first started, it computes the error in the intrinsic frequency of the clock on the computer it is running
on. This process usually takes about a day or two after the daemon is started to compute a good estimate of this (and it needs a good
estimate to synchronize closely to its server). Once the initial value is computed, it will change only by relatively small amounts during
the course of continued operation.
The driftfile declaration should always be included in the ntp.conf file. This provides xntpd with complete path name to a file in which
it can store the current value of the frequency error. That way, if the daemon is stopped and restarted, it can reinitialize itself to the
previous estimate without spending time recomputing the frequency estimate.
The ntp.drift file contains one line with the following format: freq_offset flag Specifies the nominal frequency offset. DO NOT modify
this field. Specifies the method used to improve system clock accuracy. Specifies that xntpd runs a Phase-Locked Loop (PLL) algorithm to
keep synchronized with other hosts. This is the default. Specifies the use of the PLL algorithm in the kernel. This requires the
NTP_TIME kernel option. After the option is configured in the kernel, edit the ntp.drift file and change the flag value to 1.
See System Administration for information on the NTP_TIME kernel option.
FILES
Conventional name of the drift file
RELATED INFORMATION
Commands: ntpdate(8), ntpq(8), xntpd(8), xntpdc(8)
Files: ntp.conf(4)
Network Administration, System Administration delim off
ntp.drift(4)