Linux command line: split a string
bash, split, string
Solution
cat "func_list" | sed "s#//.*##" > "file_list"
Didn't run it :)
Problem
I have long file with the following list: ``` /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl() /fs/ntfs/file.c//ntfs_prepare_pages_for_non_resident_write() /drivers/net/tg3.c//tg3_reset_hw() /arch/cris/arch-v32/drivers/cryptocop.c//cryptocop_setup_dma_list() /drivers/media/video/pvrusb2/pvrusb2-v4l2.c//pvr2_v4l2_do_ioctl() /drivers/video/aty/atyfb_base.c//aty_init() /block/compat_ioctl.c//compat_blkdev_driver_ioctl() .... ``` It contains all the functions in the kernel code. The notation is `file//function`. I want to copy some 100 files from the kernel directory to another directory, so I want to strip every line from the function name, leaving just the filename. It's super-easy in python, any idea how to write a 1-liner in the bash prompt that does the trick? Thanks, Udi