I am new in bash scripting. In my work, I provide support to several users and when I connect to their computers I use the same admin and password, so I am trying to create a script that will only ask me for the IP address and then connect to the computer without having me to type the user and password.
Here's the script:
Code:
read -p "Enter ip address: " IP_ADDRESS
pss="123@456"
open vnc://test:$pss@$IP_ADDRESS
If I remove the @ from my password I am able to connect with no issue. I have tried to escape the @ by adding a backslash before the character but still not working (e.g. 123\@456). Do you guys have any suggestions?..
Thanks in advance.
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 03-06-2019 at 04:18 AM..
Reason: Added CODE tags.
Hello
would appreciate if somebody can post a bash script that checks if the first character of the given string is equal to, say, "a"
thnx in advance (2 Replies)
I am using this character as a delimiter 'þ'
Currently, I set it straight:
DELIMITER='þ'
However, while copying the file, this character often gets mangled. Is there a bash way (perhaps using tr or printf) of generating this character.
It corresponds to
"chr(0xfe)" if using perl. (I've... (6 Replies)
Hi!
If I want to extract a character from a specific position of a string, I can use ${string:1:1} (if I want character at the position 1). How can I do the same thing, when the number of position is contained in the variable? ${string:$var:1}doesn't work, unfortunately.
Thanks in advance. (2 Replies)
In bash, how can one remove the last character of a string? In perl, the chop function would remove the last character. However, I do not know how to do the same job in bash.
Many thanks in advance. (12 Replies)
I am having issues escaping special characters in my AWK script as follows:
for id in `cat file`
do
grep $id in file2 | awk '\
BEGIN {var=""} \
{ if ( /stringwith+'|'+'50'chars/ ) {
echo "do this"
} else if ( /anotherString/ ) {
echo "do that"
} else {
... (4 Replies)
Hi,
How to use * in call to pl/sql block from shell script?
The line "select * from" is causing all files and directiores to show up in email notification but if I give all column names then it works,
Please let me know how to use '*' instead of giving all column names, in other wirds how to... (2 Replies)
My input is:
jdbc:Oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DAT A=(SID= MWDBD22)))
In the search pattern, ( and ) and . and @ are special RE, and need to be escaped \( and \) and \. and \@
how can i do it by script or command (9 Replies)
Hello,
I want to check whether string has only numeric characters. The following code doesn't work for me
#!/usr/local/bin/bash
if ]]; then
echo "true"
else
echo "False"
fi
# ./yyy '346'
False
# ./yyy 'aaa'
False
I'm searching for solution using character classes, not regex.... (5 Replies)
I am writing a bash script that will find all references to the “Well_List” in the “Comp_File”.
I am filtering a Well_List that contains the following:
TEST_WELL_01
TEST_WELL_02
TEST_WELL_11
TEST_WELL_22
GOV_WELL_1
GOV_WELL_201
PUB_WELL_57
PUB_WELL_82
.
.
Comparison... (5 Replies)
I am still learning shell scripting. Recently I see a function for read configuration. But some of special character make me confused. I checked online to find answer. It was not successful. I post the code here to consult with expert or guru to get better understanding on these special characters... (3 Replies)
Discussion started by: duke0001
3 Replies
LEARN ABOUT CENTOS
ipa-replica-install
ipa-replica-install(1) IPA Manual Pages ipa-replica-install(1)NAME
ipa-replica-install - Create an IPA replica
SYNOPSIS
ipa-replica-install [OPTION]... replica_file
DESCRIPTION
Configures a new IPA server that is a replica of the server that generated it. Once it has been created it is an exact copy of the original
IPA server and is an equal master. Changes made to any master are automatically replicated to other masters.
The replica_file is created using the ipa-replica-prepare utility.
If the installation fails you may need to run ipa-server-install --uninstall before running ipa-replica-install again.
The installation will fail if the host you are installing the replica on exists as a host in IPA or an existing replication agreement
exists (for example, from a previously failed installation).
A replica should only be installed on the same or higher version of IPA on the remote system.
OPTIONS
BASIC OPTIONS
--setup-ca
Install and configure a CA on this replica. If a CA is not configured then certificate operations will be forwarded to a master with
a CA installed.
--ip-address=IP_ADDRESS
The IP address of this server. If this address does not match the address the host resolves to and --setup-dns is not selected the
installation will fail. If the server hostname is not resolvable, a record for the hostname and IP_ADDRESS is added to /etc/hosts.
-p DM_PASSWORD, --password=DM_PASSWORD
Directory Manager (existing master) password
-w ADMIN_PASSWORD, --admin-password=ADMIN_PASSWORD
Admin user Kerberos password used for connection check
--mkhomedir
Create home directories for users on their first login
-N, --no-ntp
Do not configure NTP
--no-ui-redirect
Do not automatically redirect to the Web UI.
--ssh-trust-dns
Configure OpenSSH client to trust DNS SSHFP records.
--no-ssh
Do not configure OpenSSH client.
--no-sshd
Do not configure OpenSSH server.
--skip-conncheck
Skip connection check to remote master
-d, --debug
Enable debug logging when more verbose output is needed
-U, --unattended
An unattended installation that will never prompt for user input
CERTIFICATE SYSTEM OPTIONS
--skip-schema-check
Skip check for updated CA DS schema on the remote master
DNS OPTIONS
--setup-dns
Generate a DNS zone if it does not exist already and configure the DNS server. This option requires that you either specify at
least one DNS forwarder through the --forwarder option or use the --no-forwarders option.
--forwarder=IP_ADDRESS
Add a DNS forwarder to the DNS configuration. You can use this option multiple times to specify more forwarders, but at least one
must be provided, unless the --no-forwarders option is specified.
--no-forwarders
Do not add any DNS forwarders. Root DNS servers will be used instead.
--reverse-zone=REVERSE_ZONE
The reverse DNS zone to use
--no-reverse
Do not create new reverse DNS zone. If a reverse DNS zone already exists for the subnet, it will be used.
--no-host-dns
Do not use DNS for hostname lookup during installation
--no-dns-sshfp
Do not automatically create DNS SSHFP records.
EXIT STATUS
0 if the command was successful
1 if an error occurred
3 if the host exists in the IPA server or a replication agreement to the remote master already exists
IPA May 16 2012 ipa-replica-install(1)