07-23-2014
To tell read not to interpret backslashes, do read -r
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi!
I've just started learning shell scripting, and have been somewhat 'thrown in at the deep-end and told to swim' so excuse my complete lack of knowledge and ignorance, but here goes...
I've been given a unix script to 'tidy up'. Basically the script consists of the few lines of code being... (2 Replies)
Discussion started by: Sn33R
2 Replies
2. Shell Programming and Scripting
Hi All,
I'll get a file whose 2nd line contains 3 fields: filename(variable length), file size char(10), and record count int(10). How do I cut it and put it into 3 variables?
eg: abcd.csv01234567891111111111
now I want: $one = abcd.csv, $two = 0123456789, $three = 1111111111.
I also... (8 Replies)
Discussion started by: Mandab
8 Replies
3. Shell Programming and Scripting
Greetings all,
I'm currently making use of the $HOME/.ssh/rc file to launch an automated shell script immediately after the user has been verified through ssh.
The current problem that I'm facing now is that I am unable to use the "read" command anymore... seems like the "read" statements are... (0 Replies)
Discussion started by: rockysfr
0 Replies
4. Shell Programming and Scripting
Hi,
I want to get the first two items returned by ps -ef into two variables?
Can anyone please help
Thanks (8 Replies)
Discussion started by: JamesByars
8 Replies
5. Shell Programming and Scripting
I would like to make a script to read three variables (no fixed length or position) from a line and write them into a file, with fixed length and right-justified in each column. The fixed text (text1-text4) prior to the thee variables and the variables themselves are originally separated by spaces... (3 Replies)
Discussion started by: SharkM
3 Replies
6. Shell Programming and Scripting
If I set a variable within a while-read loop, sometimes it's local to the loop, sometimes it's global, depending on how the loop is set up. I'm testing this on a Debian Lenny system using both bash and dash with the same results.
For example:
# Pipe command into while-read loop
count=
ls -1... (2 Replies)
Discussion started by: mjd_tech
2 Replies
7. Shell Programming and Scripting
Hello All
i have input files contains 2 values as following
20-Oct-09 Z59408009
20-Oct-09 Z59423060
and i am using the following script
cat /home/or/input.txt | awk '{print $2}' >log
count=0
while read line; do
count=$(( count + 1 ))
echo "UPDATE SAT_JRLTRT SET AVT='X' WHERE... (6 Replies)
Discussion started by: mogabr
6 Replies
8. Shell Programming and Scripting
Hi,
I want to read the variables and the values from the txt file and compare these values with the ones computed by script.
for ex:
say var.txt contains the variable names and their values:
one 1
two 2
three 3
The value of variables "one" "two" and "three" will be computed in the script... (3 Replies)
Discussion started by: bhushana
3 Replies
9. Shell Programming and Scripting
Hi
I want to read variables from one file and then set it as environment variable;
The text file is test.txt which contains
SPEED:1000
IP:172.26.126.11
My code is:
while read line; do
var1=`echo $line | awk 'BEGIN {FS=":"} { print $1 }'`
echo $var1
var2=`echo $line | awk 'BEGIN {FS=":"}... (8 Replies)
Discussion started by: SSM
8 Replies
10. Shell Programming and Scripting
Heyas
Figured me had a 'typo' in tui-conf-set, i went to fix it.
Now, i also figured, it might be nice to have tui-conf-set report (to console, not only exit code) wether it could save the variable to the file or not.
This said, I appended this code: (the tui-title and tui-echo lines are... (3 Replies)
Discussion started by: sea
3 Replies
LEARN ABOUT DEBIAN
css::dom::util
CSS::DOM::Util(3pm) User Contributed Perl Documentation CSS::DOM::Util(3pm)
NAME
CSS::DOM::Util - Utility functions for dealing with CSS tokens
VERSION
Version 0.14
SYNOPSIS
use CSS::DOM::Util ':all';
# or:
use CSS::DOM::Util qw[
escape unescape
escape_ident unescape_url
escape_str unescape_str
];
DESCRIPTION
This module provides utility functions for dealing with CSS tokens.
FUNCTIONS
All functions below that take one argument have a "($)" prototype, so they have the same precedence as "closedir" and "delete".
escape $string, $chars_to_escape
This escapes any characters in $string that occur in $chars_to_escape, which is interpreted as a regular expression. The regexp must
consume just one character; otherwise you'll find chars missing from the output. ASCII vertical whitespace (except the vertical tab) is
always escaped.
Printable non-alphanumeric ASCII characters and the space character are escaped with a single backslash. Other characters are encoded
in hexadecimal.
"escape" also considers that you might want to include the escaped string in a larger string, so it appends a space if the escaped
string ends with a hexadecimal escape with fewer than six digits.
unescape $string
This turns something like "H65llo" into "Hello" (including quotes).
escape_ident $string
escape_ident $string, $more_chars_to_escape
This escapes $string as a CSS identifier, escaping also any characters matched by $more_chars_to_escape.
unescape_url $url_token
Returns the URL that the token represents.
escape_str $string
Returns a CSS string token containing $string (within quotes; characters possibly escaped).
unescape_str $string_token
Returns the value that a CSS string token represents.
SEE ALSO
CSS::DOM
perl v5.10.1 2010-12-10 CSS::DOM::Util(3pm)