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
# 8  
Old 03-12-2010
i get what your saying. but is it possible to just edit my command so i can execute it without having to continue a command?
# 9  
Old 03-12-2010
What's happening is that your command exceeds the length of buffer allowed by your shell. Or youve got an unclosed parans/quote. This buffer length varies by shell, OS, etc, but a good rule of thumb might be 250 bytes of entry and then escaping a return:

Code:
echo "blah...blah...blah..." \
"blah...blah...blah..."

Otherwise, you might explore variables some and letting the shell interpolate some of the values for you. This way some of the long strings and probable confusion over unclosed parans, etc, could also be eliminated.

The $PS2 variable is a system variable that you can define on the fly, or define in your .profile as a visual cue for such line breaks. It probably defaults to ">".

---------- Post updated at 07:18 ---------- Previous update was at 07:18 ----------

What's happening is that your command exceeds the length of buffer allowed by your shell. Or youve got an unclosed parans/quote. This buffer length varies by shell, OS, etc, but a good rule of thumb might be 250 bytes of entry and then escaping a return:

Code:
echo "blah...blah...blah..." \
"blah...blah...blah..."

Otherwise, you might explore variables some and letting the shell interpolate some of the values for you. This way some of the long strings and probable confusion over unclosed parans, etc, could also be eliminated.

The $PS2 variable is a system variable that you can define on the fly, or define in your .profile as a visual cue for such line breaks. It probably defaults to ">".
# 10  
Old 03-12-2010
thx curleb Smilie
 
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