Sponsored Content
Operating Systems Linux How to use a case stmt in a for loop? Post 302907790 by Don Cragun on Tuesday 1st of July 2014 07:20:47 PM
Old 07-01-2014
Quote:
Originally Posted by CarloM
Bear in mind that ls -rt $svdumpdir/* might return more than one file per line (unless your ls is aliased to something).
Note that ls never puts more than one filename on a line if the output is not connected to a terminal device. The -1 option is always effectively turned on when ls output is sent through a pipe.
This User Gave Thanks to Don Cragun For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

case loop... repeat on bad input?

I'm trying to get a case statement to start over if an undefined option is selected... But I am ata loss on how to actually do it. Here is a quick example of what I have. Echo "1) do this/n 2) Do that/n 3) Quit/n Make a selection/n" Read answer Case answer in 1) Dothid;; 2) Dothat;;... (3 Replies)
Discussion started by: trey85stang
3 Replies

2. UNIX for Dummies Questions & Answers

Please explain the stmt

hi, Please explain the below stmt. P=1234 var1=:/a/b/c/file.dat printf "%s %s\n" "$" "${var1#?}" Output is: 1234 /a/b/c/file.dat What is #? in printf stmt? by using that the first character( : ) of "var1" variable is not displayed in output. How is that? please explain.. ... (1 Reply)
Discussion started by: srilaxmi
1 Replies

3. UNIX for Dummies Questions & Answers

Including case insensitivity into loop command

I have the following piece of code: for file in *csv; do cat $file >> $newfile; done for file in *CSV; do cat $file >> $newfile; done and would like to know how to combine these two rules into one? The combined rule would then include the case insensitivity that I am looking for. (4 Replies)
Discussion started by: figaro
4 Replies

4. Shell Programming and Scripting

Help with awk stmt

Hi All, I have a log file as: cat error.log.tmp1 2010-07-06 23:18:34 Connection Available to xyztestftp.abc.com.my 2010-07-06 23:20:33 Connection Available to xyztestftp.abc.com.my ERROR FTP LOGIN Now I am reading this complete log file if no single occurrence of word "ERROR" (this word... (5 Replies)
Discussion started by: ss_ss
5 Replies

5. Shell Programming and Scripting

Help with Dates and SQl stmt?

hi All Please explain the below statement in RED?What does this mean? perl /HDS/common/operations/Quality_Team/Nirvana/WEEKLY_OOPS/sql_dump.pl --sql "select * from WEEKLY_REPORT order by test_case, type" --username=ddb_qa --password=ddb_qa123 --sid=pldeldb --output... (1 Reply)
Discussion started by: SVS_2017
1 Replies

6. Shell Programming and Scripting

Help With Loop in Case Statement script

I am writing a bash script that asks the user for input and I need it to repeat until the user selects quit.. I dont know how to write the loop for it I searched all over but i still do not get it.. if anyone could help with this it would be greatly apprciated here is my script so far: #!... (2 Replies)
Discussion started by: Emin_Em
2 Replies

7. Shell Programming and Scripting

Case Stmt - Need Help Urgently

Hello All, Need help urgently.. i have a scenario where i have two files 1) mireport_20111406.txt 2) PRLIHSP01_8080.2011-06-11-15_26_31 ---------- I want a query something similar to this algorithm :- Case when file_name is like mireport then extract_date=14-06-2011 when... (4 Replies)
Discussion started by: iamnoone
4 Replies

8. Shell Programming and Scripting

Case loop condition

hello, I would like to do exit at the end ie list all errors before exiting How to put the token exit in a variable with a loop ? Thanks function g1 () { case "$1" in (-0-0 | -0-1 | -0-2 | -0-3 | -1-0 | -1-1 | -1-2 | -1-3) # nothing, OK ! ;; (*) echo 'Fatal, $1 = '"'$1'"', Date... (9 Replies)
Discussion started by: amazigh42
9 Replies

9. Shell Programming and Scripting

Case sensitive in If loop .

Hi All, select app from the menu: ABC DEF GHI JKL ALL # ALL will select all the apps in the menu echo "Enter your option" read option; if then <execute the below command> elif # option is the 1 selection from menu...not ALL <execute the below command> else (14 Replies)
Discussion started by: Devaraj A
14 Replies
puts(3S)																  puts(3S)

NAME
puts(), fputs() - put a string on a stream SYNOPSIS
Obsolescent Interfaces DESCRIPTION
writes the null-terminated string pointed to by s, followed by a new-line character, to the standard output stream writes the null-terminated string pointed to by s to the named output stream, but does append a new-line character. Neither function writes the terminating null character. Notes and append a new-line character; and do not. Obsolescent Interfaces and put a string on a stream. RETURN VALUE
Upon successful completion, these routines return a non-negative number. Otherwise they return EOF, set the error indicator for the stream, and set to indicate the error. ERRORS
These routines fail if, either the stream is unbuffered or stream's buffer needed to be flushed causing an underlying call to be invoked, and: The flag is set for the file descriptor underlying stream and the process would be delayed in the write operation. The file descriptor underlying stream is not a valid file descriptor open for writing. An attempt was made to write to a file that exceeds the process's file size limit or the maximum file size (see ulimit(2)). A signal was caught during the system call. [EIO] The process is in a background process group and is attempting to write to its controlling terminal, is set, the process is neither ignoring nor blocking the signal, and the process group of the process is orphaned. There was no free space remaining on the device containing the file. An attempt is made to write to a pipe or FIFO that is not open for reading by any process. A signal is also sent to the process. Additional values may be set by the underlying function (see write(2)). WARNINGS
and are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use and SEE ALSO
ferror(3S), flockfile(3S), fopen(3S), fread(3S), printf(3S), putc(3S), orientation(5), thread_safety(5), glossary(9). STANDARDS CONFORMANCE
puts(3S)
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy