10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
2. Shell Programming and Scripting
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)
Discussion started by: sudo
3 Replies
3. Shell Programming and Scripting
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)
Discussion started by: fxsme
8 Replies
4. Shell Programming and Scripting
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)
Discussion started by: ysrini
8 Replies
5. Shell Programming and Scripting
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)
Discussion started by: aix_admin_007
3 Replies
6. Shell Programming and Scripting
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)
Discussion started by: rveri
3 Replies
7. Shell Programming and Scripting
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)
Discussion started by: yanglei_fage
7 Replies
8. Shell Programming and Scripting
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)
Discussion started by: Calbrenar
3 Replies
9. Shell Programming and Scripting
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)
Discussion started by: ultimatix
1 Replies
10. Shell Programming and Scripting
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)
Discussion started by: borderblaster
1 Replies