01-07-2012
Isolate and scrub your proc's $@ variable. If there's a good chance that someone might paste in a bum set of chars, you'd want to exclude the chance of it break your flow.
If you'd assign the inbound $@ to its own variable (such as my_var="${@}"), you can then scrub this new variable for bad chars before you'd try to parse it further.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am new to shell script. This is my first post .I have written a small script which returns list of names starts with "ram" in /etc/passwd .Here is that:-
#!/bin/ksh
NAME_LIST="name_list.txt"
cat /dev/null > $NAME_LIST
evalcmd="cat /etc/passwd | grep "^ram?*" | cut -d: -f1"
eval... (3 Replies)
Discussion started by: sachin.tendulka
3 Replies
2. Shell Programming and Scripting
Dear friends, following is the output of a script from which I want to remove spaces and new-line characters.
Example:-
Line1 abcdefghijklmnopqrstuvwxyz
Line2 mnopqrstuvwxyzabcdefghijkl
Line3 opqrstuvwxyzabcdefdefg
Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies
3. Shell Programming and Scripting
Hi,
I need a command in UNIX KSH below is the description...
MAPPING DESCRIPTION ="Test Mapping for the calid inputs" ISVALID ="YES" NAME ="m_test_xml" OBJECTVERSION ="1" VERSIONNUMBER ="1"
unix ksh command to read the DESCRIPTION and write to a file
Test Mapping for the calid inputs... (3 Replies)
Discussion started by: perlamohan
3 Replies
4. Shell Programming and Scripting
Hallo,
i need a Prompting read in my script:
read -p "Enter your command: " command
But i always get this Error:
-p: is not an identifier
When I run these in c-shell i get this error
/usr/bin/read: read: bad option(s)
How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies
5. Shell Programming and Scripting
I have to read a file line by line, change it and then update the file. Problem is, when i read the file, "read" command ignores leading spaces.
The file is a script which is indented in many places for clarity. How to i make "read" command read leading spaces as well. (3 Replies)
Discussion started by: vickylife
3 Replies
6. Shell Programming and Scripting
Hi everyone,
I`ll try to be most clear I can explaining my help request.
I have 2 folders
Folder A-->This folder receives files through FTP constantly
Folder B-->The files from Folder A are unzipped and then processed in Folder B
Sometimes Folder A doesn`t contain all... (2 Replies)
Discussion started by: cgkmal
2 Replies
7. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
8. UNIX for Dummies Questions & Answers
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies
9. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT OSF1
mkmanifest
mkmanifest(1) General Commands Manual mkmanifest(1)
NAME
mkmanifest - mtools utility to create a shell script to restore UNIX file names from DOS
SYNOPSIS
mkmanifest [files]
OPTIONS
None
OPERANDS
A list of UNIX file names to be converted to DOS name format.
DESCRIPTION
The mkmanifest command creates a shell script that aids in the restore of UNIX file names that were overwritten by DOS file name restric-
tions. DOS file names are uppercase only, cannot exceed 8 character names, 3 character extensions and do not support device names or non-
alphanumeric characters.
Not all UNIX file names are supported in the DOS world. The mtools commands may have to change UNIX names to fit the DOS file name conven-
tions. Most commands provide the verbose option (-v), that displays new file names if they have been changed. The following table shows
some examples of file name conversions:
-----------------------------------------------
UNIX name DOS name Reason for the change
-----------------------------------------------
thisisatest THISISAT file name too long
file.stuff FILE.STU extension too long
prn.txt XRN.TXT PRN is a device name
.abc X.ABC null file name
hot+cold HOTXCOLD illegal character
-----------------------------------------------
EXIT STATUS
The following exit values are returned: Success. Failure.
EXAMPLES
Assume you have the following UNIX files that you want to copy to a DOS diskette using the mcopy command.
very_long_name 2.many.dots illegal: good.c prn.dev Capital
The mcopy command converts these file names to the following:
very_lon 2xmany.dot illegalx good.c xprn.dev capital
To restore the previous file names, use the mkmanifest command as follows: mkmanifest very_long_name 2.many.dots illegal:
good.c prn.dev Capital > manifest
The previous mkmanifest command line produces the following: mv very_lon very_long_name mv 2xmany.dot 2.many.dots mv illegalx illegal: mv
xprn.dev prn.dev mv capital Capital
The good.c file name did not require conversion, hence it was not included in the output.
If these files were copied from diskette to another UNIX system, and you wanted to restore the original names, retain a copy of the mani-
fest file (captured output) so that it can be used to convert the file names again.
FILES
Executable file
SEE ALSO
Commands: mcopy(1), mtools(1)
mkmanifest(1)