How to issue a long command on unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to issue a long command on unix
# 1  
Old 03-12-2010
How to issue a long command on unix

Hi,

Im trying to create a command template here. how can i issue this long command in one enter?

echo -e "\nIssue or Request - Analysis Summary \n\nMemory Utilization Utilization Threshold\n\nResolution Summary\n\n1. check Server Info";echo "$(uname -a;uptime;date)"; echo -e "\n\n2. check Memory Utilization\n";\echo -e "$(/opt/HPO/SMSPIv2/bin/memdetail)\n";echo -e "[Additional Information Log:]\n\nFinal Analysis: Swapspace Utilization is 2% and is below threshold limit\n\nStatus: Resolved\n"

when i execute the command it shows only a part of a command

------------------------------------------------------------------
#echo "$(uname -a;uptime;date)"; echo -e "\n\n2. check Memory Utilization\n";\echo -e "$(/opt/HPO/SMSPIv2/bin/memde <
> ion\n";\echo -e "$(/opt/HPO/SMSPIv2/bin/memde




Thanks
# 2  
Old 03-12-2010
Code:
echo -e "\nIssue or Request - Analysis Summary \n\nMemory Utilization Utilization Threshold\n\nResolution Summary\n\n1. check Server Info";echo "$(uname -a;uptime;date)"; echo -e "\n\n2. check Memory Utilization\n";\echo -e "$(/opt/HPO/SMSPIv2/bin/memdetail)\n";echo -e "[Additional Information Log:]\n\nFinal Analysis: Swapspace Utilization is 2% and is below threshold limit\n\nStatus: Resolved\n"

I have executed the above command and I got the output as follows

Code:
Issue or Request - Analysis Summary

Memory Utilization Utilization Threshold

Resolution Summary

1. check Server Info
Linux ThinServer 2.6.26-2-686 #1 SMP Fri Aug 14 01:27:18 UTC 2009 i686 GNU/Linux
 14:12:32 up 2 days,  4:10, 37 users,  load average: 0.62, 0.81, 0.55
Fri Mar 12 14:12:32 IST 2010


2. check Memory Utilization

bash: /opt/HPO/SMSPIv2/bin/memdetail: No such file or directory


[Additional Information Log:]

Final Analysis: Swapspace Utilization is 2% and is below threshold limit

Status: Resolved

What is the problem you are facing?
# 3  
Old 03-12-2010
What you looking for , I have executed this it is giving me some output.Explain your requirement clearly .
# 4  
Old 03-12-2010
i cant execute the command as a whole...

Details:
Code:
#echo "$(uname -a;uptime;date)"; echo -e "\n\n2. check Memory Utilization\n";\echo -e "$(/opt/HPO/SMSPIv2/bin/memde                          <


it shows an arrow at the end. maybe if someone can help me modify my command so i can execute it as a one long command.

btw im connecting to the server remotely

Last edited by pludi; 03-12-2010 at 05:03 AM.. Reason: code tags, please...
# 5  
Old 03-12-2010
I think your PS2 variable is set like that.
Just use
Code:
echo $PS2

It will show a character. This is known as command continuation character.
For you this might be set to that character.
# 6  
Old 03-12-2010
Quote:
Originally Posted by thillai_selvan
I think your PS2 variable is set like that.
Just use
Code:
echo $PS2

It will show a character. This is known as command continuation character.
For you this might be set to that character.

do i need to add that to my command? Smilie
# 7  
Old 03-12-2010
No need. This will be automatically displayed in your shell prompt.
This indicates the user that the command is not properly end.

For example.
Code:
echo 'hello


Here the command is not properly end. Because the single quote is not enclosed.
For this it will show like
Code:
>

Once i have given the ' (single quote) then the command is properly end and will give the output as hello.
So it is better you ensure that whether all the single/double quotes / other things enclosed and ended properly.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find command take too long

Hi, I use the below script that will find n record the entire directory structure for a given folder. bash-3.2$ more mkdir.sh find . -type d |while read rec do echo "mkdir $rec" echo "chmod -R 777 $rec" #done done >> moht.sh The problem is the folder i m running this script... (10 Replies)
Discussion started by: mohtashims
10 Replies

2. UNIX for Dummies Questions & Answers

FTP that works correctly in command prompt and shows issue in UNIX server

Hi All, FTP ports opens with the given user name and password and allows to download file through COMMAND PROMPT. Code as below: H:\>ftp ftpxxxxx Connected to entvc2ft07-pub.xxxxx.com. 220 Microsoft FTP Service User (entvc2ft07-pub.xxxxx.com:(none)): userxxxxx 331 User name okay, need... (1 Reply)
Discussion started by: vijayalakshmi.r
1 Replies

3. Shell Programming and Scripting

Unix Mget command issue

Hi, I am facing an issue with mget command, below are the details The following commands are in a batch file "abc.ctl" cd /mypath/mydirectory/ mget 'MYFILE_*.touch' bye I use this file as a parameter for an sftp command sftp -b abc.ctl -oIdentityFile=$myserver -oPort=$myport >>... (0 Replies)
Discussion started by: saurabh_mh
0 Replies

4. UNIX for Dummies Questions & Answers

install command flag Linux/Unix issue

Hi all, I was trying to install from source USB_ModeSwitch on my Mac. I have always had success with the basic ./configure, make, make install commands in terminal so don't know how, why or what. The issue I came across is that the makefile.conf uses the -D flag while installing and on UNIX... (0 Replies)
Discussion started by: jprokos
0 Replies

5. Shell Programming and Scripting

How long screen command runs?

Does screen command run forever? Suppose I have following command inserted at my putty shell followed by screen # screen # export JAVA_HOME=/usr/java/jdk1.6.0_21 # export ANT_HOME=/usr/ant # export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin # export... (0 Replies)
Discussion started by: ninadgac
0 Replies

6. Programming

POSIX mq_receive issue: Message too long

Hello, I am trying to implement posix message queue application. I am faced with an error on the mq_receive section. It says "Message too long". I've tried couple of small tweeks, but to no result. Please do suggest any rectificaitons. mq_send section-works successfully #include... (2 Replies)
Discussion started by: katwalatapan
2 Replies

7. Shell Programming and Scripting

Issue with Unix cat command

Hi Experts, I am finding the performance of cat command is very wierd, it is taking more time to merge the files into a single file. We have a situation where we would be merging more than 100 files into a single file, but with cat command it is running slow. I tried doing with paste, join... (13 Replies)
Discussion started by: RcR
13 Replies

8. UNIX for Dummies Questions & Answers

Unix command mmin issue

hi, Function 'mmin' is not in my unix, what is the other alternative to find files created/modified in last 10 minutes. Unix Command: find . -min -10 find: bad option -min find: path-list predicate-list Thank you (1 Reply)
Discussion started by: Mohee
1 Replies

9. Shell Programming and Scripting

Re: Long command lines

Hello, AIM: Need to test for the presence of some files (*.F) in a certain directory. having a problem with this line is ksh: if test `ls $SOMEDIR/dir/*.F \ 2>/dev/null|wc -w` -eq 0 Basically testing for the presence of *.F files in the specified directory. If the return... (4 Replies)
Discussion started by: enoch
4 Replies

10. UNIX for Dummies Questions & Answers

entering a long command

hello everyone! Very basic question for the guru's in here but anyways, I am trying to type a command that is longer than the line. What character do I use to continue my command on the next line? Thanks in advance.... Todd (1 Reply)
Discussion started by: hedrict
1 Replies
Login or Register to Ask a Question