Hi all,
I have a text file containing sql commands. I want to use sed to replace the " character with the ' character. But when i run the command below it just replaces it with a space? Do i have the escape the ' character if i want to use it?
cat sql.txt
update customer set custid =... (1 Reply)
Hi
I have to replace in around 60 files a word an replcae it by another
Suppose all the files have a word intelligent i want to replace it by idiot
I am planning to use sed for executing this job
sed 's/\intelligent/idiot/g'
I plan to have a file (test.txt) which contains... (1 Reply)
I'm trying to do an ls from inside of a ksh script. I loop through the results one line at a time and attempt to do a substitution using sed to convert YYYYMMDD from the older files into the newer files. Basically sometimes the ETL load runs over midnight and half the files are off by one day... (3 Replies)
I want change the file when the line contains $(AA) but NOT contains $(BB), then change $(AA) to $(AA) $(BB)
eg:
$(AA) something
$(AA) $(BB) something (7 Replies)
Hi Experts,
A quick question.
- How to put a 2nd bracket in the last character of the input string.
a=blah or a=1234 or a=anything
Desired output to be :
bla or 123 or anythin
What I have tried is not working:
echo $a| sed 's/$//'
blah
Thanks a lot. (3 Replies)
Below i am trying to remove "/" and "r" from the output, so i need output as:
hdiskpower3
hdisk0
hdisk1
#inq | grep 5773 | awk '{print $1}' | sed 's/dev//g' | awk -F"/" '{$1=$1}1'
.....................................................//rhdiskpower0
//rhdiskpower1
//rhdiskpower2... (3 Replies)
I want to get the last character from my machine name using the following code, the default shell is bash, the script runs in ksh.
I get 'bad' substitution error on running the script, but works fine if run using dot and space.
Why?
$ echo $0
bash
$ cat -n myenv.sh
1 ... (8 Replies)
Hi,
1/
i have file test.txt
1 Jul 28 08:35:29 2014-07-28 Root::UserA
1 Jul 28 08:36:44 2014-07-28 Root::UserB i want to delete the seconds of the file, and the Root:: and the output will be:
1 Jul 28 08:35 2014-07-28 UserA
1 Jul 28 08:36 2014-07-28 UserB 2/i have another file test2.txt:... (8 Replies)
OSX
I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code... (3 Replies)
A portion of my input is as follows:
1087 IKON01,49 A WA- -1 . -1 . 0 W WA- -1 . -1 . 0 . -1 . -1 -1 -1 -1 -1 -1 W
1088 IKON01,49 A J.@QU80MW. 2... (2 Replies)
Discussion started by: jvoot
2 Replies
LEARN ABOUT LINUX
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)