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:
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 DEBIAN
tsql
tsql(1) FreeTDS Utilities tsql(1)NAME
tsql - utility to test FreeTDS connections and queries
SYNOPSIS
tsql { -S servername [-I interface] | -H hostname -p port }
-U username [-P password] [-o options]
tsql -C
DESCRIPTION
tsql is a diagnostic tool provided as part of FreeTDS. It uses the TDS protocol directly to connect to Sybase or Microsoft SQL Servers, and
allows the user to issue queries that test the capabilities of FreeTDS.
tsql is *not* a replacement for a complete isql, such as sqsh (www.sqsh.org). It is designed to rely on the lowest level FreeTDS library,
tdslib, as a way to isolate potential bugs in the protocol implementation.
tsql can be run in two ways, one which uses the freetds.conf and one which connects directly using the server's hostname and port.
When -S is used, FreeTDS uses the freetds.conf (or equivalent) and environment variables in the normal way to determine the server's ip
address and port. You can use -I to specify a filename, overriding FreeTDS's configuration file search algorithm.
The -H and -p parameters are provided especially for troubleshooting new configurations (or servers). Use of these parameters causes
FreeTDS to ignore any freetds.conf and environment variables.
OPTIONS -S servername
the Database Server to which to connect.
-I interface
a freetds.conf or interfaces file describing servername
-H hostname
the DNS hostname of the server
-p port
the port at which SQL Server is listening
-U username
database login name. If username is not provided, a domain login is attempted for TDS 7+ connections.
-P password
database password.
-L list server "instances" (with -H)
-C prints some of the compile-time configuration parameters.
-o options
apply the options specified to every command.
f No footer [result count]
h No header [titles]
t Print time
v Print version
q Quiet
NOTES
Typing "exit", "quit", or "bye" (or ^D) exits tsql.
Typing "version" displays the TDS protocol version.
Command batches may be separated with "go" or "GO". If "GO", the version string is reported before executing the batch.
After prompting for the password, tsql will attempt to connect to the remote
server.
tsql displays a counter indicating the number of seconds that
it is attempting to connect.
Typically, tsql should immediately respond
with a '1>' prompt.
If you see the counter (1, 2, 3, ...), most likely tsql is unable to connect to the indicated server.
If you can connect with "tsql -S servername", your basic FreeTDS installation is working.
If you have suggestions for ways to make tsql more useful as a diagnostic tool, please recommend them to the FreeTDS mailing list for con-
sideration.
HISTORY
tsql first appeared in FreeTDS 0.60.
AUTHORS
The tsql utility was written by Brian Bruns.
BUGS
Several, to be sure, now that it's documented. :)
doc 13 November 2011 tsql(1)