Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Waiting for wildcard filename to exists in while loop Post 302917000 by RudiC on Saturday 13th of September 2014 04:17:01 AM
Old 09-13-2014
The while doesn't - it couldn't care less. The test -f does - and has to. It needs exactly one single file, or it will issue an error msg. Don't use the double quotes as they prevent the shell from evaluating the wild card.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find wildcard .shtml files in wildcard directories and removing them- How's it done?

I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days... The structure of the paths are like this: /home/domains/www.domain2.com/tgp/ /home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies

2. Shell Programming and Scripting

test if a filename exists with specified string (ksh)

I'm trying to do a simple if statement that tests if a filename exists with a user specified string. So say I have these files: Assigned_1day_after_due_chuong Assigned_1day_after_due_gallen Assigned_1day_after_due_heidenre and i'm running a script and want to know if a... (6 Replies)
Discussion started by: bob122480
6 Replies

3. Shell Programming and Scripting

filename in loop

i have a filename_1=file1.dat filename_2=file2.dat i want to pass the filename in a loop for((i=1;i<=2;i++) do awk{print $1} $filename_$i.dat done how should i pass the filename (2 Replies)
Discussion started by: r_t_1601
2 Replies

4. Shell Programming and Scripting

ksh(!93) for loop with wildcard and empty directory

I'm sure this is by design, but using something like for f in dir/* do echo $f done produces unexpected (to me) results if run against an empty directory. I'd have expected it to not execute the loop, but it actually calls it with f set to 'dir/*'. Now I know that I'm trying to protect... (2 Replies)
Discussion started by: spr00t
2 Replies

5. Shell Programming and Scripting

Use the information from filename in a for loop

hi here is my script set -vx b=`cat /info_d05/visage/SrcFiles/Customer_Master/Log_Files/last_date.txt` for name in /info_d05/visage/SrcFiles/Customer_Master/Input_Files/* do fname=`basename $name` p=`$fname|cut -d"_" -f6|sed 's/\(.*\)....../\1/'` if then cp... (6 Replies)
Discussion started by: djrulz123
6 Replies

6. Shell Programming and Scripting

Wildcard search in if loop

Practice folder contains many files and im interested in extracting file which starts with abc* ghi* xyz* . I need to do variety of operations for different files. if file starts with xyz* then i need to move to some destination otherwise some other destination. I am not able to make wildcard... (15 Replies)
Discussion started by: kumaar1986
15 Replies

7. Shell Programming and Scripting

For loop without checking file exists

In several scripts that process files matched by name pattern I needed to add a check for file existence. Just to illustrate let's say I need to process all N??? files: /tmp$ touch N100 N101 /tmp$ l ?10 -rw-rw-r-- 1 moss group 0 Apr 19 11:22 N100 -rw-rw-r-- 1 moss group ... (10 Replies)
Discussion started by: migurus
10 Replies

8. Shell Programming and Scripting

Verify if filename exists

Hi, I have a variable returned from Oracle SQL Function which holds file names. I would like to test if all the file names mentioned in the string exists in a directory. If all the files exists print "exists", even if one file does not exists print "Does not exists". e.g. ... (3 Replies)
Discussion started by: pointers1234
3 Replies

9. AIX

Issue with wildcard in filename (AIX 7.1.0.0)

Hi, This has been pestering me for quite a while, any help will be highly appreciated The current directory has a file with below name npidata_20050523-20171210.csv The below wildcard matched the above file ls -ltr npidata_????????-201712??.csv But when the part '201712' is put... (6 Replies)
Discussion started by: zulfi123786
6 Replies
pcser(7D)																 pcser(7D)

NAME
pcser - PCMCIA serial card device driver SYNOPSIS
serial@<socket>:pcser serial@<socket>:pcser,cu The pcser PCMCIA serial card device driver supports asynchronous serial I/O access to any PCMCIA card that that complies with Revision 2.1 of the PCMCIA standard and which represents an 8250-type UART interface. PRECONFIGURE
If a PC card modem or serial device is recognized, the pcser device driver is automatically loaded, ports and IRQs allocated, and special files created (if they don't already exist). CONFIGURATION
Configuration steps include initial installation and configuration, identifying an unrecognized device and misidentifying a recognized device. Initial Installation and Configuration 1. Install the Solaris software. 2. Boot the system. 3. Insert the modem or serial device. Identifying an Unrecognized Device If you insert a PC card modem or serial device and it is not recognized (that is, no special files are created under /dev/cua or /dev/term), use the prtconf command to find the problem: 1. Become root. 2. Run the prtconf -D command to see if your modem or serial device is recognized. An unrecognized device will appear at the end of the prtconf output. For example: # prtconf -D . . . pcic, instance #0 (driver name: pcic) . . . pccard111.222 (driver not attached) 3. If your device is not recognized, use the add_drv command to add the name of your device as another known alias for pcser devices. For example, type the following at the command line: # add_drv -i'"pccard111.222"' pcser Note - Include the double quotes in single quotes to keep the shell from stripping out the double quotes. Use the identification string listed in the prtconf output. Use the entire string in the add_drv command. See add_drv(1M). Misidentifying a Recognized Device 1. Run the prtconf -D command to see if your modem or serial device is erroneously recognized as a memory card. If the device is incor- rectly recognized as a memory card, the output of the prtconf command could show: # prtconf -D . . . pcic, instance #0 (driver name: pcic) . . . memory, instance #0 (driver name: pcmem) pcram, instance #0 (driver name: pcram) 2. Use the Configuration Assistant to identify the memory resource conflict, and add correct information for the device on the View/Edit Devices menu. Typically, the problem may be a resource conflict between device memory settings. A PC Card adapter chip that is not fully supported may also be the cause of the problem. 3. To work properly with the Solaris operating environment, all devices must be accounted for, even those the Solaris environment does not support. The Configuration Assistant software accounts for all devices in your system. Additional Configuration When adding a new serial port or modem to the system, you often need to edit configuration files so that applications can use the new com- munications port. For example, the /etc/uucp/Devices file needs to be updated to use UUCP. See Overview of UUCP in the System Administra- tion Guide. For PPP on the serial port, see pppd(1M) and Solaris PPP Overview in the System Administration Guide. Special Files The serial devices in /dev/term and /dev/cua are named by socket number. A card inserted in socket 0 is pc0, and socket 1 is pc1. Hot Plugging If a PC Card modem or serial device is unplugged while in use, the device driver returns errors until the card is replaced in the socket. The device must be closed and reopened with the card reinserted before the device begins working again. The restart process depends on the application. For example, a tip session automatically exits when a card in use is unplugged. To restart the system, you must restart the tip session. /kernel/drv/pcser pcser driver /dev/term/pcn dial-in devices /dev/cua/pcn dial-out devices where: n is the PCMCIA physical socket number. cu(1C), tip(1), uucp(1C), autopush(1M), pcmciad(1M), ports(1M), ioctl(2), open(2), pcmcia(7D), termio(7I ), ldterm(7M), ttcompat(7M) pcser: socket n soft silo overflow The driver's character input ring buffer overflowed before it could be serviced. pcser: socket n unable to get CIS information The CIS on the card has incorrect information or is in an incorrect format. This message usually indicates a non-compliant card. 10 Sep 2002 pcser(7D)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy