10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good.
Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog.
The only additional code I've added is in bold below (|... (4 Replies)
Discussion started by: woodson2
4 Replies
2. Shell Programming and Scripting
i have a file seperated each line seperated by newline. For example
alpha
beta
gamma
i am trying to replace the newlines to "," but dont want , present at the end of the line so i am trying the below one liner . but not sure whats wrong but its not working
cat myfile | tr -s '\n' ',' | sed... (9 Replies)
Discussion started by: chidori
9 Replies
3. Shell Programming and Scripting
Hi, wondering if it's been asked before but didn't find matches from google. Basically I have this line:
myvar=$(echo -e "a\tb")
Now somehow the '\t' from the echo output gets replaced with white space and then stored in $myvar.
It creates a problem for me later to use tab as delimiter to do... (2 Replies)
Discussion started by: birddie
2 Replies
4. UNIX for Dummies Questions & Answers
How do i tell my bash shell script to test the output of the command i'm using?? I want this script to look for lines not equal to 1 then let me know..
$ cat blah ; echo ---- ; cat blah.sh
1 fe
1 fi
1 fo
0 fum
1 blahda
1 blah
0 blahh
1 bla
1 bl
1 blahhh
----
#!/bin/bash
while... (1 Reply)
Discussion started by: phpfreak
1 Replies
5. Shell Programming and Scripting
Is it possible to pipe a command in to an instant messenger e.g pidgin, finch or something similar and have it send??? e.g echo "hello" | messenger Or is there anything similar?? Thanks in advance! (1 Reply)
Discussion started by: 64mb
1 Replies
6. Shell Programming and Scripting
Dear forum
I have the following small script:
#!/bin/ksh
echo -e "abba-o" | awk -F '-' '{ print $2 }' | cut -b 1It needs to be ksh.. in bash I don't have this problem.
If I run this on opensuse 10.2 I get this as output: e
If I run this on suse enterprise 10 sp2 then I get this: o
... (1 Reply)
Discussion started by: gemtry
1 Replies
7. Shell Programming and Scripting
Hello all,
I am new to bash. I am trying to get a sub string of a variable in a shell script. While trying to do that I get the following error:
------------------------------------------------------------------------
OHOME: /aaa/bbb/product/eee
./t.sh: line 6: /aaa/bbb/product/eee: No... (4 Replies)
Discussion started by: RockyC123
4 Replies
8. Shell Programming and Scripting
Hi,
I was wondering why ls * | echo does not print the contents of the directory to the screen? The way I see it, ls * returns a whole lot of information, and then we pipe all this info to echo, so surely it should all come to our screen!
Is there a serious flaw in my understanding?
... (3 Replies)
Discussion started by: A1977
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I did not understand why the following did not work out as I expected:
find . -name "pqp.txt" | grep -v "Permission"
I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson... (1 Reply)
Discussion started by: 435 Gavea
1 Replies
10. Shell Programming and Scripting
Hi. Im using cat to output the contents of a file, then piping it to my while read loop.In this loop variables get assigned values. However when i try to use the variables outside the loop their values has been reset.I understand about subshells etc. but I have no idea how to "preserve" the... (3 Replies)
Discussion started by: Ultimodiablo
3 Replies