03-06-2009
Perl - How do you break the long line of codes into 2?
I'm trying to make this long line of codes in Perl looks nice by dividing it into 2 lines...
Before:
`echo "blahblahblahblahblahblahblahblahblahblahblah" > ~/lalala/lalala/lalala/lalala/lalala/abc`;
After:
`echo "blahblahblahblahblahblahblahblahblahblahblah" >
~/lalala/lalala/lalala/lalala/lalala/abc`;
But the command stops working if I do that. Is there any way to break it into 2 lines like what I have (in After) and still ensure that it works?
Last edited by teiji; 03-06-2009 at 01:28 AM..
Reason: fixed command
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I apologize if I have already posted this query. I scanned back quite a few pages but could not find such a query.
If my perl code contains "exit(33)" how can I get that value in bash for use in a "if" statement.
Thanks,
Siegfried (5 Replies)
Discussion started by: siegfried
5 Replies
2. Shell Programming and Scripting
hi All,
Have a doubt in ksh..Am not familiar with arrays but i have tried out a script..
plzzzzz correct me with the script
My i/p File is:
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 192.168.2.2)
(Port = 1525)
)
)
(CONNECT_DATA = (SID = TESTDB1)
)
)
... (7 Replies)
Discussion started by: aajan
7 Replies
3. Shell Programming and Scripting
Hi,
I am interesting in writing the following bash codes into perl
My script is simple take field 2 in /etc/passwd and put into an array
#!/bin/bash
PASSWD_FILE=/etc/passwd
A=(`awk -F: ' { print $2 }' $PASSWD_FILE `)
Can someone give me equivalent codes in perl ? (1 Reply)
Discussion started by: phamp008
1 Replies
4. Shell Programming and Scripting
I am trying to break a large file into smaller ones, with the break defined by the character "*".
The following is the code I have so far which breaks the input file on every line instead of at the "*" character.
Input file:
1
2
3
4
*5
6
7
8
9
Code:
#!/usr/bin/perl... (2 Replies)
Discussion started by: cold_Que
2 Replies
5. Shell Programming and Scripting
...when the lines use both a colon and commas to separate the parts you want read as information.
The first version of this script used cut and other non-Bash-builtins, frequently, which made it nice and zippy with little more than average processor load in GNOME Terminal but, predictably, slow... (2 Replies)
Discussion started by: SilversleevesX
2 Replies
6. Solaris
I get a file which has all its content in a single row.
The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file.
I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Discussion started by: ducati
4 Replies
7. Shell Programming and Scripting
I cannot seem to get this to work..
I have a file which has about 100 lines, and there is no end of line (line break \n) at the end of each line, and this is causing problem when i paste them into an application.
the file looks like this
this is a test
that is a test
balblblablblhblbha... (1 Reply)
Discussion started by: fedora
1 Replies
8. UNIX for Dummies Questions & Answers
So I'm in a Unix class and our assignment was to go into VI and write a script to make this file tree. At the end of it, I'd like it to echo "This is the file tree you've created" then a line break, then . But I'm not sure as to who to do it. Is there a way for when I run it (./filesystem), the... (4 Replies)
Discussion started by: bbowers
4 Replies
9. Shell Programming and Scripting
Hello everyone!
I'm trying to make the below file1 look like file2, can anyone help?
Basically I just hit backspace on every line that starts with a number.
Thanks!
file1:
THIS#IS-IT1
4
THIS#IS-IT2
3
THIS#IS-IT3
2
THIS#IS-IT4
1
Result > file2: (4 Replies)
Discussion started by: demmel
4 Replies
10. Shell Programming and Scripting
This is actually a KSH under Unix System Services (Z/OS), but hoping I can get a standard AIX/KSH solution to work...
I have a very large, single line file in Windows, that we download via FTP, with the "SITE WRAP" option, into a Z/OS file with an LRECL of 200. This essentially breaks the single... (4 Replies)
Discussion started by: bubbawuzhere
4 Replies