473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Output following Command

Hi All

I am using the following command to get the output like this
home1
pandadk
sandbox
odm
odm_daa
pub_odm_daa_test1
run

Expand|Select|Wrap|Line Numbers
  1. echo "/home1/pandadk/sandbox/odm/odm_daa/pub_odm_daa_test1/run"|awk '{split($0,a,"/"); for(i=1; i<=NF; i++) print a[i]}'
But it is returning me nothing.

Please advise.

Thanks
Dilip
Sep 15 '08 #1
2 1871
ashitpro
542 Expert 512MB
Hi,
Please look at your for loop...
What is 'NF' here?
Have you tried replacing 'NF' with some constant?
You would definitely get the answer.

Regards,
Ash
Sep 15 '08 #2
ghostdog74
511 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. echo "/home1/pandadk/sandbox/odm/odm_daa/pub_odm_daa_test1/run" | tr "/" "\n"
  2.  
or
Expand|Select|Wrap|Line Numbers
  1.  echo "/home1/pandadk/sandbox/odm/odm_daa/pub_odm_daa_test1/run" | awk  '1' RS="/" 
  2.  
Sep 15 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Hugh Macdonald | last post by:
I'm calling a command from within a python script and I need to be able to both catch the output (stdout and stderr) from it and also have the PID (so that I can kill it) I can do one or other...
2
by: Erik Hendrix | last post by:
Hi, When I run a DB2 command: i.e.: db2 list tablespaces show detail and while this is running do: ps -ef | grep "db2 " then I can see in the output the db2 command as: db2 list tablespaces...
54
by: bnp | last post by:
Hi, I took a test on C. there was an objective question for program output type. following is the program: main() { char ch; int i =2;
5
by: Tom Lam lemontea | last post by:
Hi all, This is my very first post here, I've seriously tried some programming on C, and shown below is my very first program(So you can expect it to be very messy) that I wrote after I've learned...
2
by: Will Rickards | last post by:
In my web application there is an interactive report. Then there need to be a printable version a pdf. So I found this java tool csstoxslfo and the java fop tool from apache that will take my...
0
by: F.C. | last post by:
Hello, :) I'm currently writing a frontend for a console application using VB .net. I'm using the traditional Process creation to launch it and redirect input and output to my windows...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
4
by: garyusenet | last post by:
Hi. I am trying to learn about array lists, and found an example on MSDN. I tried to compile it but it's not producing any output. I can't see why. Any ideas? Here is what I did. 1....
0
by: ptek | last post by:
Hi, I'm using Vstudio 2005 and I did a Windows Application project where I also want to read arguments from command line and output some text when appropriate (for example, typing the correct...
16
by: Okonita via DBMonster.com | last post by:
Hi all, I am comming along with all this Linus/DB2/scripting business...I am no longer scared of it!! (LOL). But, I need to create a .ksh script that does a REORGCHK and output only tables...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.