Assign nothing to a file in the script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Assign nothing to a file in the script
# 1  
Old 01-03-2013
Assign nothing to a file in the script

Hello everybody,

In Mainframe, when I want to assign nothing to an output file created by a cobol program in a JCL, I do:

CUSTOMER DD DUMMY.

How can I do this in my script unix ?

Thanks in advance!
Best regards
# 2  
Old 01-03-2013
Hi

Like sending the output to nowhere? >>/dev/null
or like creating and empty file? touch somenamefile

If you add the first after any command line in your script, the output of that command will not be seen on screen or registered on log.

Regards
# 3  
Old 01-03-2013
Thanks Ikaro0,
I tried but same issue. I got a file called 'null'.

I want to send my file to nowhere. Actually, I use in the script an export statement that puts the output to a given address. I'd want to change it. I'd want to send the output to nowhere.

best regards
# 4  
Old 01-03-2013
Hi Nolo41

/dev/null is a null device, a special file that discard any data written to it.
From Wikipedia:

/dev/null - Wikipedia, the free encyclopedia

If you type like
Code:
echo test >> /dev/null

You will send test to nowhere.

What error do you get?

Regards.
# 5  
Old 01-04-2013
Thanks Ikaro0,

I got no error. As you told me, the null file is created and it discards any data writen in it. It is empty.

However, I am looking for an output without creating any file. Is that possible ?

Thanks again
# 6  
Old 01-04-2013
Hi Nolo41, the null file has not been created by you, it exist in UX systems.
This User Gave Thanks to Ikaro0 For This Post:
# 7  
Old 01-04-2013
Great! Thanks Ikaro0 !
Best regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to read through a file and create new users/assign them to groups in Ubuntu

Hi all. I need a shell script that can, in short, read through a text file line by line and create a new user in Ubuntu, as well as assign that user to a group. The format of the text file is not important but preferably: 'username:group'. I don't have much programming knowledge no matter shell... (3 Replies)
Discussion started by: LewisWeekly
3 Replies

2. Shell Programming and Scripting

How to read each line from input file, assign variables, and echo to output file?

I've got a file that looks like this (spaces before first entries intentional): 12345650-000005000GL140227 ANNUAL HELC FEE EN 22345650-000005000GL140227 ANNUAL HELC FEE EN 32345650-000005000GL140227 ANNUAL HELC FEE EN I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies

3. Shell Programming and Scripting

Assign specific Color to the outputs in script

Hi, Im programming an interactive menu that verifies the exports of my oracle DB, and im having some trouble finding a process that outputs for example a green command line when the export terminated successfully. i have something like this cat... (15 Replies)
Discussion started by: blacksteel1988
15 Replies

4. Shell Programming and Scripting

Read record from the text file & assign those values to variables in the script

For eg: I have sample.txt file with 4 rows of record like: user1|password1 user2|password2 user3|password3 user4|password4 The username and password is sepsrated by '|' I want to get the 1st row value from the file and assign it to two different variables(username and password) in my... (1 Reply)
Discussion started by: priya001
1 Replies

5. Shell Programming and Scripting

How to write script read file and assign it as variable?

Hi all, I want write a csh script which must be able: 1.read a file 2.assign value in file as variable and can i use read in csh script? thx (2 Replies)
Discussion started by: proghack
2 Replies

6. Shell Programming and Scripting

how to assign the output of the interective script to the variable

Hi, I work in ksh88. I have an interective script which prompts the user for the input and returns numeric value depending on the input provided. I need to call this script inside another script and then assign the resulting output the the variable. The call like that A=`my script` obviously... (6 Replies)
Discussion started by: aoussenko
6 Replies

7. Shell Programming and Scripting

how to assign script argument to a variable

I have a script file. test.sh I am running it by command sh test.sh 10102004 where 10102004 is the script argument. I wan to assign this 10102004 to a variable. How can i do this? I tried &1 and awks ARGV its not working :( (2 Replies)
Discussion started by: rohankit
2 Replies

8. IP Networking

Script to assign mutiple IP's to 1 nic

I need a script to assign multiple IP addresses to a single nic. The machine is running CentOS. Any help would be appreciated. (2 Replies)
Discussion started by: ron310
2 Replies

9. Shell Programming and Scripting

how to assign multiple values in a pl/sql script

Hello friends, This query is with regards to a script (pl/sql) which returns multiple values. Please see below script wherein the query returns a single value and is assigned to a single variable DB_VALID_CDR=`sqlplus -s user/pass<<!EOF | grep -v "^Connected" 2>&1 set termout off echo... (2 Replies)
Discussion started by: vivek_damodaran
2 Replies

10. Shell Programming and Scripting

Assign script parameters to variables

Hi, I have a bash script that accepts some parameters as input, like: sh script.sh first second third ..... I want to save these parameters as different variables, something like: VAR1=first VAR2=second etc I tried this, but apparently it didn't worked....... (16 Replies)
Discussion started by: giorgos193
16 Replies
Login or Register to Ask a Question