create file and name it with same output name !


 
Thread Tools Search this Thread
Operating Systems AIX create file and name it with same output name !
# 1  
Old 12-22-2010
create file and name it with same output name !

Guy's

I have this command echo $? when I type it in AIX it will showme 0

I want when I type that command to create file in the same location with the same output of echo $?

For exampl :

I will execute the command now ....

P_server/root/echo $?
0

the output is 0 so I want to create file in the same location which is /root with name 0


how can I do this idea ... Pls your advice ...
# 2  
Old 12-22-2010
Code:
 
touch $(echo $?)

# 3  
Old 12-22-2010
Quote:
Originally Posted by Mr.AIX
Guy's

I have this command echo $? when I type it in AIX it will showme 0

I want when I type that command to create file in the same location with the same output of echo $?

For exampl :

I will execute the command now ....

P_server/root/echo $?
0

I am sorry but am I missing something here? Can we assume that P_server/root/ is the PWD echoed into the command prompt line or are you saying that you execute the command "P_server/root/echo $?"? Which directory are you in when you execute this? The reason I ask is the command will look for the echo command in the path P_server/root/ from whereever the command is being run from, the root directory "/" for example.

That is what is not clear to me.

the output is 0 so I want to create file in the same location which is /root with name 0


how can I do this idea ... Pls your advice ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies

2. Shell Programming and Scripting

How to create a file from output of vertica table query in UTF-8 format?

Hello, In my shell script, I extract table data from HP Vertica DB into a csv file using vsql -c command. But the problem is the file getting created is in binary format and hence some of the data becomes unreadable which has chinese characters as part of data. file -i filename.csv - gives... (2 Replies)
Discussion started by: Dharmatheja
2 Replies

3. Shell Programming and Scripting

Need a script to create specialized output file

I need a script to process the (space-separate) values for each line as seen in the below input file and then output the data into an output file as follows. We have been unable to create this using typical bash scripting and cold not find anything out on the internet similar to what we are trying... (3 Replies)
Discussion started by: ddirc
3 Replies

4. Shell Programming and Scripting

Create specific output

I have a file that looks like the below and only need certain lines, but am not sure how to do that. It is basically everything from the @HD up to the @RG. Thank you :). file.txt - input @HD VN:1.4 GO:none SO:coordinate @SQ SN:chr1 LN:249250621 @SQ SN:chr2 LN:243199373... (3 Replies)
Discussion started by: cmccabe
3 Replies

5. Shell Programming and Scripting

Create a two column output in bash

Hi! I m newbie for scripting. My requirement is to create a host file as below from the output of aws api. Hostname PrivateIP abc x.y.x.z cde a.b.c.c and so on. I have the following script, #!/bin/bash export AWS_ACCESS_KEY=abc export... (5 Replies)
Discussion started by: cuteboyucsc
5 Replies

6. UNIX for Dummies Questions & Answers

Create csv with output filenames and file size

Hello All, Here is seeking a bit of help in trying to solve a problem. I am required to create a csv file as shown below: output.csv -> output_1,output_2,output_3,...,output_<N> filename1:20,filename2:30,filename3:30,...,filename<N>:30 by listing output_1, output_2,... , output<N> as... (3 Replies)
Discussion started by: vkumbhakarna
3 Replies

7. UNIX for Dummies Questions & Answers

Read a flat file, evaluate and create output. UNIX SCRIPT.

Hi all, I have a flat file as below; 470423495|1||TSA-A000073800||1|||1 471423495|1||TSA-A000073800||5|||5 472423495|1||TSA-A000073800||2|||7 473423495|1||TSA-A000073800||3|||3 I like to create a Unix script. The script have to valuate the last two columns, if the values are... (4 Replies)
Discussion started by: mrreds
4 Replies

8. Shell Programming and Scripting

to create an output file as a table

Hi, I have four input files and would like to create an output file as a table. Please check the example below. File 1. 111111 222222 333333 444444 File 2. 555555 666666 777777 888888 File 3. aaaaa bbbbb ccccc ddddd (2 Replies)
Discussion started by: marcelus
2 Replies

9. Shell Programming and Scripting

Read multiple log files and create output file and put the result

OS : Linux 2.6.9-67 - Red Hat Enterprise Linux ES release 4 Looking for a script that reads the following log files that gets generated everynight between 2 - 5am Master_App_20090717.log Master_App1_20090717.log Master_App2_20090717.log Master_App3_20090717.log... (2 Replies)
Discussion started by: aavam
2 Replies

10. UNIX for Dummies Questions & Answers

how to create output like this

currently i have two clients connecting to my wifi router in telnet router, i typed the command : ~# dumpleases then it showed as following: Hostname Mac Address IP-Address billfan 00:15:00:15:c1:7e 192.168.11.100 00:16:cf:47:e7:ab... (4 Replies)
Discussion started by: billfanyang
4 Replies
Login or Register to Ask a Question