10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am having problem while redirecting output to a file where as on console output is proper.
for dir in */; do printf "%s, " "$dir"; ls -m "$dir"; echo; done > output.txt
Output of above command is coming in single line but when i am redirecting output to a file, single line i... (10 Replies)
Discussion started by: Manoj Rajput
10 Replies
2. Shell Programming and Scripting
Hello,
I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer?
I cannot use scp, because it's blocked.
something like:
ssh root@remote_maschine "cat /file" > /locale_machine/file
:rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies
3. Shell Programming and Scripting
HI
I am trying to grep 3 characters from hostname and append a character at the end.
I tried as in the following:
root@abag3:~# hostname | cut -c1-3
hyu
Now I am trying to append "g" at the end of this output as in the following.
root@abag3:~# hostname | cut -c1-3 | sed -s... (4 Replies)
Discussion started by: Priya Amaresh
4 Replies
4. Shell Programming and Scripting
Hi
I am trying to write output to a file in columns
I have file in the follwoing:
# cat file
abc
def
#
I am trying to write next output as like
# cat file
abc 123
def 345
#
:mad: (6 Replies)
Discussion started by: Priya Amaresh
6 Replies
5. UNIX for Dummies Questions & Answers
Team,
we use below command to store the contents in a logfile.
cat a.txt > a.log
a.txt content is
123
345
Is there any options available to store the command used also?
for eg a.log may show as
cat a.txt
123
345 (5 Replies)
Discussion started by: sid2013
5 Replies
6. Shell Programming and Scripting
I have a file
# cat /root/llll
11
22
33
44
When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat.
cat /root/shell_script.sh
#!/bin/bash
var=`cat /root/llll`
echo $var (2 Replies)
Discussion started by: anil510
2 Replies
7. UNIX for Dummies Questions & Answers
I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going??
cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies
8. Shell Programming and Scripting
Hi All,
Please help me writing the below script.
I have two sql queries.
1. Select count(1),Client_id from TABLE_A group by Client_id;
2. Select count(1),Client_id from TABLE_B group by Client_id;
I need the output of above two sql queries in a single file. The output 2nd query should be... (4 Replies)
Discussion started by: 46019
4 Replies
9. Shell Programming and Scripting
Hello,
I'm new to shell scripting and did a search on the forum to what I want to do but couldn't find anything.
I have about 9 routers that outputs to 1 syslog file daily named cisco.year.mo.date.log ex: cisco.2009.05.11.log
My goal is to make a parsing script that cats today's syslog... (2 Replies)
Discussion started by: jjrambar
2 Replies
10. Shell Programming and Scripting
Hi All,
Could you ppl plz help me in writing into a file , plz find the example below.
Ex:
Name1|092387|Address1
Name2||Address2
After executing command/script the file should look like
Name1|092387|Address1
Name2|+91900236|Address2
plz let me know of you have some solution... (4 Replies)
Discussion started by: shreekrishnagd
4 Replies