The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding Multiple Lines to Multiple Files dayinthelife Shell Programming and Scripting 2 06-04-2008 11:50 AM
removing pattern which is spread in multiple lines sabyasm Shell Programming and Scripting 2 05-13-2008 05:19 AM
retrieved multiple lines on multiple places in a file dala Shell Programming and Scripting 8 03-14-2008 03:28 PM
spawning multiple processes spread across two files StrengthThaDon High Level Programming 1 09-17-2007 05:03 PM
multiple sed commands george_ Shell Programming and Scripting 5 03-30-2006 10:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-07-2006
tphyahoo tphyahoo is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 24
Can I spread commands over multiple lines?

Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis?

I'm thinking this would allow for neater looking scripts, specially if there are a lot of obscure parameters being passed in with hyphens.

Thanks!

Code:
$ls -l #l flag gives more output
insgesamt 4
drwxr-xr-x  2 hartmann users 144 2006-06-07 14:57 a
drwxr-xr-x  2 hartmann users 144 2006-06-07 14:57 b
-rwxr--r--  1 hartmann users 546 2006-06-07 15:01 diffem.pl
$( ls
> -l # l flag gives more output
> )
a  b  diffem.pl
bash: -l: command not found
$
  #2 (permalink)  
Old 06-07-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Use a backslash for line continuation:

Code:
ls \
-l
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0