Shell one liner help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell one liner help
# 1  
Old 10-06-2016
Shell one liner help

Hello,

I am trying to sort/get some specific output from a ls command but however I am having no luck. The command I am using is

Code:
'ls -al /nim/dr/mksysb/\*'|grep -e _dr -e .tgz|cut -c37-90|cut -d" " -f2-8|cut -d_ -f1

the error is
Code:
bash: ls -al /nim/dr/mksysb/\*: No such file or directory

Any help would be appreciated.


Thanks,
Hasan

---------- Post updated at 01:23 PM ---------- Previous update was at 01:23 PM ----------

FYI....there are files under /nim/dr/mksysb directory


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 10-06-2016 at 03:31 PM.. Reason: Added CODE tags.
# 2  
Old 10-06-2016
Try without the single quotes around the ls ... command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Curl one liner

Hi I am trying to write a curl one-liner that will help me to input the password after intiating the upload. Also this curl job needs to run on the background and transfer the verbose output to a file. So we can tail the file and check the status if required. This is curl command that I am... (1 Reply)
Discussion started by: cutechaps
1 Replies

2. Shell Programming and Scripting

help with sed one liner

hey everyone, I want to remove some characters from a string that i have with sed. For example if my string is: a0=bus a1=car a2=truck I want my output to look like this: bus car truck So i want to delete the two characters before the = and including the =. This is what i came up with... (3 Replies)
Discussion started by: GmGeubt
3 Replies

3. Shell Programming and Scripting

Search & Replace regex Perl one liner to AWK one liner

Thanks for giving your time and effort to answer questions and helping newbies like me understand awk. I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk. Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies

4. Shell Programming and Scripting

help one liner...

Hi I have a log data that shows chunks of data like this: thisis example test, this is example test, this is example test thisis example test, this is example test, this is example test thisis example test, this is example test, this is example test thisis example test, this is example test,... (2 Replies)
Discussion started by: erick_tuk
2 Replies

5. Shell Programming and Scripting

Need a one liner

abc/abc1/abc2/abc3/abc4 i need a script to pick this above path when ever any patterns like the below will be found. abc/abc1 abc/abc1/abc2 abc1/abc2/abc3 abc2/abc3/abc4 abc2/abc3/ etc .... etc..... not only the above 5 but like these one.. any one liner will be of great... (1 Reply)
Discussion started by: debu182
1 Replies

6. UNIX for Dummies Questions & Answers

need an awk one liner

example input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

7. UNIX for Dummies Questions & Answers

awk one liner

I need a one liner to" find /pattern/ print from x lines before "pattern" to y lines after "pattern" (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

8. Shell Programming and Scripting

awk one liner

input a 100 200 300 b 400 10 output a 100 a 200 a 300 b 400 b 10 Thanx (6 Replies)
Discussion started by: repinementer
6 Replies

9. Shell Programming and Scripting

Need help passing variables in shell script to perl one-liner

I'm writing a script to automate some post-install tasks on RHEL4 servers. I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file,... (1 Reply)
Discussion started by: Xek
1 Replies

10. Shell Programming and Scripting

merging CSV data using a one liner from shell?

I'm trying to merge multiple CSV (comma separated value) files into one large master file. All files have a field that is unique to act as the key for entry/merging into the master file & and all files have the same number of fields that are in the master file. I'll give an example here: ... (2 Replies)
Discussion started by: jjinca
2 Replies
Login or Register to Ask a Question