01-11-2002
Finding out the length of a string held within a variable
Does anyone know which command I can use to find out the length of a string held within a variable?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. Shell Programming and Scripting
I tried creating a variable with the awk command. The correct value is being printed to the screen; however, the variable max is not being set. The command "echo $max" is null. Any help would be greatly appreciated. Thank you.
cat test.txt:
-rw-r--r-- 1 root root 0 2005-01-12 20:51... (2 Replies)
Discussion started by: cstovall
2 Replies
3. Shell Programming and Scripting
I have a customer who logged some cc and bank account numbers in their apache logs. I got the cc numbers x'd out with
sed -e 's/args=\{16\}/args=XXXXXXXXXXXXXXXX/g' -e 's/cardnum=\{16\}/cardnum=XXXXXXXXXXXXXXXX/g'but that wasn't too difficult due to the value being 16 digits.
The bank account... (7 Replies)
Discussion started by: mk4mzid
7 Replies
4. Shell Programming and Scripting
Hi all,
I am trying to find the best way of making a change to 1 char in a string, the string can be between 1 and 14 characters.
I am reading a line in from a file which contains
012341231231:2:102939283:NNN: Require :NBN:
012838238232:3:372932:NNN: Require :NNB:
I need to change 1 N or a... (8 Replies)
Discussion started by: nkwilliams
8 Replies
5. Shell Programming and Scripting
Hi,
I'm building an installation system that uses separate data
files that contain the individual characteristics of each package.
Within the data file, I would like to incorporate a section that
contains a bash script that is loaded into an array which is
then redirected to bash to be... (13 Replies)
Discussion started by: ASGR
13 Replies
6. Shell Programming and Scripting
I have a field MPN-BANK-NUMBERO:006,00:N in a file FILE1
How can i display the length of the Bank Number.Any idea ?
The output shud take the following format
FILE 1 6
Where 1 is the starting position and 6 is the Ending position. (9 Replies)
Discussion started by: bobby1015
9 Replies
7. Shell Programming and Scripting
Hello all,
source file looks like this:
cat toto.txt
NAME)
VAR1=tata
OPT4=toto
USER=blabla
TZ=/usr/share/zoneinfo/Hongkong
OTHEROPT=something
;;
NAME2)
VAR1=tata
OPT4=toto
USER=blabla
TZ=/usr/share/zoneinfo/Hongkong
SOMETHING=else
... (5 Replies)
Discussion started by: maverick72
5 Replies
8. Shell Programming and Scripting
I have a string like
Months=jan feb mar april x y ..
Here the number of fields in Months is not definite
I need to extract each field in the Months string and pass it to awk . Don't want to use for in since it is a loop . How can i do it (2 Replies)
Discussion started by: Nevergivup
2 Replies
9. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
10. UNIX for Beginners Questions & Answers
My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data.
... (7 Replies)
Discussion started by: chandrath
7 Replies
LEARN ABOUT DEBIAN
clear_locks
clear_locks(1M) System Administration Commands clear_locks(1M)
NAME
clear_locks - clear locks held on behalf of an NFS client
SYNOPSIS
/usr/sbin/clear_locks [-s] hostname
DESCRIPTION
The clear_locks command removes all file, record, and share locks created by the hostname and held on the current host, regardless of which
process created or owns the locks.
This command can be run only by the super-user.
This command should only be used to repair the rare case of a client crashing and failing to clear held locks. Clearing locks held by an
active client may cause applications to fail in an unexpected manner.
OPTIONS
-s Remove all locks created by the current machine and held by the server hostname.
OPERANDS
The following operands are supported:
hostname name of host server
EXIT STATUS
0 Successful operation.
1 If not root.
2 Usage error.
3 If unable to contact server (RPC).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
fcntl(2), attributes(5)
SunOS 5.10 6 Oct 2004 clear_locks(1M)